필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by