フィルターのクリア

x-y-Coordinates given in *.mat-file - Find max and min. values and assign parametername

3 ビュー (過去 30 日間)
Christopher Schoß
Christopher Schoß 2022 年 4 月 25 日
回答済み: Anagha Mittal 2022 年 4 月 28 日
Hello!!
I have given a positions.mat file with two columns for x- and y-Coordinates of points in a plane.
In my *.m-file I want to access these coordinates and find the minimum and maximum value in both directions (x and y).
I want to assign the following names to these values: Xmin, Xmax, Ymin, Ymax.
Can somebody help me with the code in my .m file?
THANK YOU!!

回答 (1 件)

Anagha Mittal
Anagha Mittal 2022 年 4 月 28 日
Hi!
This code will help in getting the maximum and minimum value of X and Y coordinates:
m = matfile('positions.mat');
pos = m.pos;
Xmin = min(pos(:,1));
Xmax = max(pos(:,1));
Ymin = min(pos(:,2));
Ymax = max(pos(:,2));
Please note that here the variable pos might have a different name in your file. You may replace that accordingly.

カテゴリ

Help Center および File ExchangeManage Products についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by