17/5/20 4:00 PM MATLAB Command Window 1 of 4: Error: Unbalanced or Unexpected Parenthesis or Bracket
17/5/20 4:00 PM MATLAB Command Window 1 of 4: Error: Unbalanced or Unexpected Parenthesis or Bracket
17/5/20 4:00 PM MATLAB Command Window 1 of 4: Error: Unbalanced or Unexpected Parenthesis or Bracket
f=
@(x)cos(x)-x
>> fzero(f,0)
ans =
0.7391
f=
@(x,y)cos(x)-x-2*y
>> fzero(f,00
fzero(f,00
|
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.
>> fzero(f,0)
Error using fzero (line 289)
FZERO cannot continue because user supplied function_handle ==> @(x,y)cos(x)-x-2*y failed with
the error below.
>> fzero(f,0,2)
Error using fzero (line 289)
FZERO cannot continue because user supplied function_handle ==> @(x,y)cos(x)-x-2*y failed with
the error below.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
17/5/20 4:00 PM MATLAB Command Window 2 of 4
>>
>>
>>
>>
>>
>>
>>
>>
>> f=@(x) cos(x)-29*x
f=
@(x)cos(x)-29*x
>> fzero(f,0)
ans =
0.0345
>> ezplot(f,[0,1])
>> grid
>> printf
Undefined function or variable 'printf'.
>>
>> ezplot(@(x) x^4,[0,100])
Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up
its evaluation and avoid the need to loop over array elements.
> In ezplot>ezplot1 at 485
In ezplot at 145
>> ezplot(@(x) x^4,[-100,100])
Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up
its evaluation and avoid the need to loop over array elements.
> In ezplot>ezplot1 at 485
In ezplot at 145
>>
>>
>>
>> x=1:1:10
x=
1 2 3 4 5 6 7 8 9 10
>> y=1:2:10
y=
1 3 5 7 9
>> plot(x,y)
Error using plot
Vectors must be the same lengths.
>> y=x^2
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
>> syms x
>> x=1:0.5:10
x=
Columns 1 through 9
Columns 10 through 18
Column 19
10.0000
>> y=x^3
Error using ^
17/5/20 4:00 PM MATLAB Command Window 4 of 4
>> y=x.^3
y=
1.0e+03 *
Columns 1 through 9
Columns 10 through 18
Column 19
1.0000
>> plot(x,y)
>> plot(x,y0
plot(x,y0
|
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.
>> plot(x,y)
>>
>> fprintf
Error using fprintf
Not enough input arguments.
>>