- #1
Erkan Tur
- 5
- 1
Moved from a technical forum, so homework template missing.
Hello everyone, I've stuck on a problem, and I need help
Problem:
1: a) Evaluate and store the sine and cosine values of the values from 0 to 260 10 by 10 and store them to the separated arrays called sines and cosines before plotting the sinusoidal graphs of these arrays, b) Evaluate the Tangent of these values by simply using these arrays c) Use the built-in sin and cos functions to evaluate same results and compare the results with yours, explain the reason of the differences
My Steps on Solving the Problem
I've wrote the code, like this:
clear
sines = [0:10:260]
sin(sines)
subplot(1, 2, 1)
stem(sines,sind(sines)), grid on
hold on
cosines = [0:10:260]
cos(cosines)
subplot(1, 2, 2)
stem(cosines, cosd(cosines)), grid on
Problems I've encountered:
I was not able to define sine and cosine function, I've used the built-in functions for sine and cosine functions,
And I need help on defining new tangent array. I need to know, should I define the values for tangent as sin(n)/cos(n), or can I directly multiply arrays in order to get that done?
Thank you in advance
Problem:
1: a) Evaluate and store the sine and cosine values of the values from 0 to 260 10 by 10 and store them to the separated arrays called sines and cosines before plotting the sinusoidal graphs of these arrays, b) Evaluate the Tangent of these values by simply using these arrays c) Use the built-in sin and cos functions to evaluate same results and compare the results with yours, explain the reason of the differences
My Steps on Solving the Problem
I've wrote the code, like this:
clear
sines = [0:10:260]
sin(sines)
subplot(1, 2, 1)
stem(sines,sind(sines)), grid on
hold on
cosines = [0:10:260]
cos(cosines)
subplot(1, 2, 2)
stem(cosines, cosd(cosines)), grid on
Problems I've encountered:
I was not able to define sine and cosine function, I've used the built-in functions for sine and cosine functions,
And I need help on defining new tangent array. I need to know, should I define the values for tangent as sin(n)/cos(n), or can I directly multiply arrays in order to get that done?
Thank you in advance