Convert 3D matrix in 2D data matrix

1 回表示 (過去 30 日間)
Willemijn Wolf
Willemijn Wolf 2017 年 3 月 15 日
回答済み: Alexandra Harkai 2017 年 3 月 15 日
Hi. I have to create for every x a graph that plots the results of Hquest2 v.s. h for 4 different t's. With Hrow I try to store data to plot for at least one of my x values. This is now an 4X1X20 but I would actually like to store this data in a 2D matrix (4x20). How can I efficiently do this in this loop?
xquest2 = [(labdaw/4), (labdaw/2.0), labdaw] ;
Hrow = zeros(i,j,h)
z = linspace(20,25,20) ;
for i = 1:3;
for j = 1:4;
for h = 1:20;
Hquest2(j,i,h) = H0*exp(-x(i)/labdaw - delta*z(h)/d1) *cos(omega*t(j) - a*x(i)/labdaw - delta*z(h)/d1);
end
end
Hrow = Hquest2(:,i,:);
end

採用された回答

Jan
Jan 2017 年 3 月 15 日
I'm not sure what your question is. A guess:
Hrow = squeeze(Hquest2(:,i,:));
Hrow = zeros(i,j,h) looks confusing already. What is i,j,h here?

その他の回答 (1 件)

Alexandra Harkai
Alexandra Harkai 2017 年 3 月 15 日
Hrow = squeeze(Hquest2(:,i,:));

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by