Value of a variable not changing in the workspace ??

3 ビュー (過去 30 日間)
Ramesh Bala
Ramesh Bala 2019 年 2 月 18 日
コメント済み: Ramesh Bala 2019 年 2 月 20 日
The value of j goes upto 1025 but i stays at 255 itself ,what's the error in this nested loop??
X = load('x.mat');
Y = load('y.mat');
for i=245:61503
i = i+10;
for j=1:1024
j=j+1;
figure(); hold on
plot(Y.y(1:i,j))
set(0,'DefaultFigureWindowStyle','docked')
end
end
hold off
  5 件のコメント
Rik
Rik 2019 年 2 月 18 日
Why don't you try explaining what you want to do? That way we can try to solve your actual issue, instead of the errors from your solution.
Ramesh Bala
Ramesh Bala 2019 年 2 月 18 日
Alright I have x =1x1024 and y = 61503x1024 matrices
X =x,Y=y
I'm trying to plot a 2D plot and 3D plot for it at every 10th step:
Like for y 1:247 and then y 247:494 till 61503 , x goes as 1 and linearly to 1024
so the normal plot goes as for 2D : plot(Y.y(1:247,1) for the first plot and goes on
I would like to convert this data to 3D values and then plot surf for it.
May be not for all the values just for 1,mid value and end value.

サインインしてコメントする。

採用された回答

ibabinaca
ibabinaca 2019 年 2 月 18 日
編集済み: ibabinaca 2019 年 2 月 18 日
Why are you putting j = j+1? There is no need to put it with matlab.
X = load('x.mat');
Y = load('y.mat');
for i=245:10:61503
for j=1:1024
figure(); hold on
plot(Y.y(1:i,j))
set(0,'DefaultFigureWindowStyle','docked')
end
end
hold off
By the way, 245+10*n is never going to be 61503
  3 件のコメント
Ramesh Bala
Ramesh Bala 2019 年 2 月 18 日
Alright you're right , for i=247:10:61503 this goes to 61503.
Could you lemme know how can I convert it to 3D values and the plot a surf out of it?
Ramesh Bala
Ramesh Bala 2019 年 2 月 20 日
Alright matlab crashes for sure :) due to rendering issues.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by