PDA

View Full Version : How can I write a program (mat lab problem)?


AkiraCole
Oct 14, 2010, 05:24 AM
How can I write a program (mat lab problem)?
HELP PLEASE! I


write a program that write a table of sinus numbers 1.0, 1.1,. 2.0 with the following format

x sin(x)
1.0 0.841
1.1 0.891
1.2 0.932
...

galactus
Oct 15, 2010, 05:51 AM
A rather simplistic apprach is to just use a small 'for' loop.

Type:

for n=1:10
s(n)=sin(1+.1*n)
end

This loops through from n=1 to 10. For more or less solutions, change the 10 to whatever you wish.

AkiraCole
Oct 19, 2010, 08:11 AM
Thank you so much!