how to write this in matlab???? and plot graph between y and x;

z=2;
y=0.5-0.00167(z-2)sin(π(x+0.1)/(18.5-0.3(z-2) ))-0.00184(x-3)(z-2)

8 Comments

MATLAB does not have implicit multiplication. You need to put in * or .* operators.
y=(0.5-0.00167.*(z-2)).*sin*((pi(x+0.1)/(18.5-0.3.*(z-2))))-0.00184.*(x-3).*(z-2).... but it is showing error;
If you have z=2, dont you just get 0.5? What is the point of this equation
You need pi*(whatever is next)
sorry i have given a random value of z as z=2; actual value of z is 1
y=(0.5-0.00167.*(3-2)).*sin((pi.*(x+0.1)/(18.5-0.3.*(3-2))))-0.00184.*(x-3).*(3-2); for z=3, still it is showing error
what is x? you need to define x. on my machine it works fine

Sign in to comment.

 Accepted Answer

x=1:10
z=1
y=(0.5-0.00167.*(3-2)).*sin((pi.*(x+0.1)/(18.5-0.3.*(3-2))))-0.00184.*(x-3).*(3-2);
Copy and paste this

2 Comments

thanks sir for ur help @ walter Roberson
It was PromoCodeBSJ who provided the solution; I just reformatted it to look nicer.

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!