Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to solve the following matlab problem?

2 ビュー (過去 30 日間)
Jabir Al Fatah
Jabir Al Fatah 2014 年 5 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
This is the code in which I am working on right now.
% b = 10000; % frequency
a = 0.5; %amplitude
c=440*1.0595^(3);
for j = 1:7;
for i= 1:24;
A(i,j)= a*cos(b*i)+c; %c is used for make an offset
end;
surf(A);
Now, The goal is to adjust the line A(i,j)=cos(i) so that the plot shows about 50 cosine curves in the middle of the day, and about 5 curves in the middle of the night. Here, total of 24 rows, first row is 12 o'clock, middle of the day. I have to play with values for these 3 constants (b, a and c) until my plot is correct (or fit with the above description). I have tried a lot by changing the value but I failed. Please help me. And ask me for update if my question is not clear to you. Thank you.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 5 月 18 日
Is this your homework? You're going to need 3 single for loops, one for each part of the day, not two nested for loops.
t = 1 : 50
for h = 1 : 8
A(h,:) = ...some function of t.......
end
for h = 9 : 16
A(h,:) = ...
end
for h = 17 : 24
A(h,:) = ...
end

この質問は閉じられています。

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by