Question: Some useful Matlab Commands : To program commands such as if x 0 then y = x 2 use the following code : if x

Some useful Matlab Commands :
To program commands such as if x0 then y=x2 use the following code :
if x0
y=x2;
end
To program commands such that if x0 then y=x2 else y=cos(x) use
the following code :
if x0
y=x2;
else
y=cos(x);
end
To program commands such that if x0 then STOP FOR LOOP use the
following code :
if x0
break;
end
Note that when this is used in a for loop the break will simply goto the end of
the for loop and continue executing the remaining command after the end of the
for loop.
To print output on the command window saying 'Here is the output 'use
the following code :
output =[ 'Here is the output '];
% this will store the string of alphabets in an array called output
output
% typing output with no semi colon after it will simply display the contents on
%the command window
Matlab command for ex.
exp(x);
% Note that if x is an array then exp(x) will be an array with each element
% being the exponential of the corresponding element of x.
Matlab command for |x| :
?abs(x);
% Note that if x is an array then abs(x) will be an array with each element
% being the absolute value of the corresponding element of x.
Write a matlab program to locate a solution of the equation 6(ex-x)=
7+3x2+2x3 between -1 and 1 using the bisection method.
 Some useful Matlab Commands : To program commands such as if

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!