how to create different matrices?

조회 수: 2(최근 30일)
arian hoseini
arian hoseini 2022년 12월 7일
댓글: arian hoseini 2022년 12월 7일
i have 30,000 rand value that i want to separate 400 to 400...then i wanna plot them but the x axis should start at 0 not 400 or 800 or...any help please?
  댓글 수: 3
arian hoseini
arian hoseini 2022년 12월 7일
for the matrix lets say i have 10 num in a matrix but i want to change it into 10 matrices...
[1 2 3 4 5 6 7 8 9 10]
[1]
[2]
.
.
[10]

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

채택된 답변

Jonas
Jonas 2022년 12월 7일
you could split them into multiple 400x1 vectors by this
data=rand(30000,1);
data=reshape(data,400,1,[]);
size(data)
ans = 1×3
400 1 75
you can then get each vector using indexing data(:,:,idx)
for idx=1%:75 % commented out to avoid to much plotting here
plot(0:399,data(:,:,idx));
% saveas(gcf,[num2str(idx),'.jpg']);
end
  댓글 수: 11
arian hoseini
arian hoseini 2022년 12월 7일
thanks

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

추가 답변(0개)

태그

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by