In this case i want to / already take(n) the biggest Absol-value, because of that i have to process the number in 'Pos' and 'Value', sequentially 11 and -3.4. what i want to ask is:
  • what function did i have to use to take value of 'Pos' and 'Value' separately and combined ? so far i just learn about max/min and other functions but it's only dscribe itself and not other data
  • could you give me the example of this with value of 'Value' and 'Pos' separately and combined taken? thanks alot for this to help my study in make thesis :)
much love
data in MATLAB is simplified like this
Table = [ 1 2 3 4 5; %Number
7 8 9 11 15; %Pos
0.8 1.5 3 -3.4 2; %Value
0.8 1.5 3 3.4 2;] %Absol-value
Table = 4×5
1.0000 2.0000 3.0000 4.0000 5.0000 7.0000 8.0000 9.0000 11.0000 15.0000 0.8000 1.5000 3.0000 -3.4000 2.0000 0.8000 1.5000 3.0000 3.4000 2.0000
choose_abs_tab = max(Table(4,:))
choose_abs_tab = 3.4000
% we get the value of choose_abs_tab is at cell (4 , 4)
%after this step i want to take data at cell (3,4) and cell(2,4)
%problem asked is what i write it

댓글 수: 6

Rik
Rik 2022년 9월 22일
What is your input in terms of Matlab variables, and what is the output you want in terms of Matlab variables? It sounds like it will be fairly easy to solve your problem, but currently it is not clear enough for me what your actual problem is.
M Adli Hawariyan
M Adli Hawariyan 2022년 9월 22일
편집: M Adli Hawariyan 2022년 9월 22일
Thanks for the comment, @Rik
it is just from my calculation i've taken the biggest value at 'Absol-Val' row, which is 3.4 . so i want to take the value all above like this
Number 4
Pos 11
Value -3.4
how to take this data:
  • separately?
  • and also, combined?
because when i use function " max( : ,4)" , it is just get the value of it, and because of that i have to take data value above it
sorry for my bad english, i hope you get the idea about this problem
Edit1#
since the data we get from function " max( : ,4)" where it placed at cell (4 , 4) . so how to make this "automatically" take the value at cell (3,4) and cell (2,4)? what function do we have to use?
thanks,
Hawariyan
Dyuman Joshi
Dyuman Joshi 2022년 9월 22일
편집: Dyuman Joshi 2022년 9월 22일
What Rik is asking is, what is your data format?
Is it numeric? If so, all in one array
mat=[1 2 3 4 5
7 8 9 11 15
0.8 1.5 3 -3.4 2
0.8 1.5 3 3.4 2]
Or individual variables?
Number = [1 2 3 4 5]
Pos = [7 8 9 11 15]
Value = [0.8 1.5 3 -3.4 2]
Absol_Val = [0.8 1.5 3 3.4 2]
Or is the data in a table? or a cell array?
Rik
Rik 2022년 9월 22일
You don't show your Matlab variables (neither input nor output). Without it I cannot provide you with adequate help.
M Adli Hawariyan
M Adli Hawariyan 2022년 9월 22일
편집: M Adli Hawariyan 2022년 9월 22일
thanks for the comment, @Dyuman Joshi
both seems fine, and i've already updated the table the problem with a single table to make easier to read which is like this too:
Edit1#
data in MATLAB is simplified like this
Table = [ 1 2 3 4 5;
7 8 9 11 15;
0.8 1.5 3 -3.4 2;
0.8 1.5 3 3.4 2;]
choose_abs_tab = max(Table(4,:))
% we get the value of choose_abs_tab is at cell (4 , 4)
%after this step i want to take data at cell (3,4) and cell(2,4)
%problem asked is what i write it
Really apriciated for helping me, much love
Thanks a lot,
Hawariyan
Thanks for the comment, @Rik
i've already update the table, which is like this:
Edit1#
data in MATLAB is simplified like this
Table = [ 1 2 3 4 5;
7 8 9 11 15;
0.8 1.5 3 -3.4 2;
0.8 1.5 3 3.4 2;]
choose_abs_tab = max(Table(4,:))
% we get the value of choose_abs_tab is at cell (4 , 4)
%after this step i want to take data at cell (3,4) and cell(2,4)
%problem asked is what i write it
Really apriciated for helping me, much love

댓글을 달려면 로그인하십시오.

 채택된 답변

Dyuman Joshi
Dyuman Joshi 2022년 9월 22일

0 개 추천

Table = [ 1 2 3 4 5;
7 8 9 11 15;
0.8 1.5 3 -3.4 2;
0.8 1.5 3 3.4 2;];
[maxabsval,maxid] = max(Table(4,:)) %this will get the first index of maximum value in the row
maxabsval = 3.4000
maxid = 4
Separate
pos=Table(2,maxid)
pos = 11
val=Table(3,maxid)
val = -3.4000
Together
valpos=Table(2:3,maxid)
valpos = 2×1
11.0000 -3.4000

댓글 수: 2

M Adli Hawariyan
M Adli Hawariyan 2022년 9월 22일
Hello, Mr @Dyuman Joshi
Thanks for the answer!!
anyways, do you have reccomendation for "cheat sheet" or books about array funtion / other function in MATLAB? thanks
Sincerely,
Hawariyan
Dyuman Joshi
Dyuman Joshi 2022년 9월 22일
편집: Dyuman Joshi 2022년 9월 22일
I can suggest you to go through the MATLAB documentation -
You can also take the MATLAB Onramp Course

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2022년 9월 22일

편집:

2022년 9월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by