フィルターのクリア

How can I select a specific cell?

3 ビュー (過去 30 日間)
Max Behr
Max Behr 2019 年 7 月 7 日
回答済み: Kaustav Bhattacharya 2019 年 7 月 8 日
Hello,
I got a matrix like this:
z=[0,2,3,4;2,3,4,5;6,7,8,9]
z =
0 2 3 4
2 3 4 5
6 7 8 9
And would like to use this command:
idx=find(time1>0 & time1<=4);
result=sum(values1(idx))/length(idx);
1. Instead of typing in the time manually I would like to say
idx=find(time1>z(1,1)( & time1<=z(1,4));
Does this works?
2. And how can I save the result into a specific place within the vector? For example in the first place like this:
result(1,1)=sum(....);
Thank you!

採用された回答

Kaustav Bhattacharya
Kaustav Bhattacharya 2019 年 7 月 8 日
This can be done.
Only this line is syntactically wrong: idx=find(time1>z(1,1)( & time1<=z(1,4));.
It should be idx=find(time1>z(1,1) & time1<=z(1,4));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by