Sir, I drew the graph below, but I could not do the above. I'll be glad if you take a look.
Below graph:
A = 60;
B = 160;
%Setting up the figure%
X_Position = 100;
Y_Position = 100;
Width = 1200;
Height = 300;
figure('Position', [X_Position Y_Position Width Height])
%Case a)%
r = (0:256);
r(r > A & r < B) = 0;
s = r;
subplot(1,3,1); plot(s,'LineWidth',2);
title("Option a)")
xlabel("r"); ylabel("T(r)");

3 件のコメント

Image Analyst
Image Analyst 2020 年 11 月 17 日
What else is there to do? You made the plot, so what else do you want? The "above" just gives you instructions for making those waveforms, which you've done, so what's the remaining problem?
Rooter Boy
Rooter Boy 2020 年 11 月 17 日
Sir, i want to graph of option b. I can't do graph of option b.
Image Analyst
Image Analyst 2020 年 11 月 17 日
I don't see any such labels "Option a" or "Option b" on the image. You plotted the waveform in the lower half of the image and titled it "Option a)" - not sure why. But it looks like you accepted Ameer's answer so I guess you're all set.

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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 17 日
編集済み: Ameer Hamza 2020 年 11 月 17 日

0 投票

Try this
A = 60;
B = 160;
%Setting up the figure%
X_Position = 100;
Y_Position = 100;
Width = 1200;
Height = 300;
figure('Position', [X_Position Y_Position Width Height])
%Case a)%
r = (0:256);
r(r > A & r < B) = 0;
s = r;
subplot(1,3,1); plot(s,'LineWidth',2);
title("Option a)")
xlabel("r"); ylabel("T(r)");
r = (0:256);
s = zeros(size(r));
s(r > A & r < B) = 250;
subplot(1,3,2); plot(s,'LineWidth',2);
title("Option b)")
xlabel("r"); ylabel("T(r)");

3 件のコメント

Rooter Boy
Rooter Boy 2020 年 11 月 17 日
編集済み: Rooter Boy 2020 年 11 月 17 日
Sir, option b is not correct. It will start at y[i]=25 & 255
Ameer Hamza
Ameer Hamza 2020 年 11 月 17 日
The plot was not clearly visible. Change the last part of the code to
r = (0:256);
s = 25*ones(size(r));
s(r > A & r < B) = 255;
subplot(1,3,2); plot(s,'LineWidth',2);
title("Option b)")
xlabel("r"); ylabel("T(r)");
Rooter Boy
Rooter Boy 2020 年 11 月 17 日
Sir, thank you for answer.

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

その他の回答 (0 件)

質問済み:

2020 年 11 月 17 日

コメント済み:

2020 年 11 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by