Getting and calculating value from matrix

9 visualizaciones (últimos 30 días)
Esra Demirbilek
Esra Demirbilek el 30 de Mzo. de 2022
Editada: Mahmoud Ashraf el 30 de Mzo. de 2022
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.

Respuestas (1)

Mahmoud Ashraf
Mahmoud Ashraf el 30 de Mzo. de 2022
Editada: Mahmoud Ashraf el 30 de Mzo. de 2022
Yy_new=[new_m(:,1) Yy]

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by