Getting and calculating value from matrix

3 ビュー (過去 30 日間)
Esra Demirbilek
Esra Demirbilek 2022 年 3 月 30 日
編集済み: Mahmoud Ashraf 2022 年 3 月 30 日
Hello everyone,
this is my code;
birincifazson: 37 25 12 45 3 32 41 ......
A1: 1 5 3 8 2 1 1 ......
.
.
.
...
resultt = birfazson(1,birfazson(2,:) == 1).'
new_m = [resultt birincisure(1,resultt).']
proctime=[birincisure(1,resultt).'] ;
Yy = zeros(numel(proctime),3);
Yy(:,1) = proctime(:,1);
Xx = cumsum(Yy(:,1));
Yy(2:end,2) = Xx(1:end-1);
Yy(:,3) = Xx(:);
and these are matrix outputs;
resultt ; new_m; Yy; Xx;
37 37 5 5 0 5 5
41 41 6 6 5 11 11
32 32 8 8 11 19 19
33 33 2 2 19 21 21
I made the operations for the 1 values ​​in the A1 line in the code part. I want to do the same operations for 2, 3 ,4...10 in row A1. And I want to print the obtained values ​​into Yy matrix . (next to the first job)
Also, I want to print the values 37,41,32,33 in new-m in matrix Yy.
like this:
37 5 0 5
41 6 5 11
32 8 11 19
33 2 19 21
How can I do it?
Thanks advence.

回答 (1 件)

Mahmoud Ashraf
Mahmoud Ashraf 2022 年 3 月 30 日
編集済み: Mahmoud Ashraf 2022 年 3 月 30 日
Yy_new=[new_m(:,1) Yy]

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by