Documentos de Académico
Documentos de Profesional
Documentos de Cultura
prod(A)
• If A is a vector, then prod(A) returns the product of the
elements.
• if A is a nonempty matrix, then prod(A) treats the columns of A
as vectors and returns a row vector of the products of each
column.
• if A is an empty 0-by-0 matrix, prod(A) returns 1.
clc
• clears all input andoutput from the Command Window display,
giving you a "cleanscreen.“
clear
• removes all variables from the current workspace, releasing
them from system memory.
clear name1 … nameN
• clear name1 ... nameN removesthe variables name1... nameN
from memory.
disp(x)
• displays the contents of X without printing the variable name.
• doesn’t display empty variables.
To clear command window content (This will not affect the Workspace
variables it will clear the command content only)
>> clc
After executing the previous commands the
works space will have these variables
To clear a and b
>> clear a b
Exercises: write a suitable MATLAB command that will generate
the same result
>> a=[[1:5];linspace(6.7,8.15,5);[5:-1:1]] '
a=
1.0000 6.7000 5.0000
2.0000 7.0625 4.0000
3.0000 7.4250 3.0000
4.0000 7.7875 2.0000
5.0000 8.1500 1.0000
>> b=[a,a]
b=
1.0000 6.7000 5.0000 1.0000 6.7000 5.0000
2.0000 7.0625 4.0000 2.0000 7.0625 4.0000
3.0000 7.4250 3.0000 3.0000 7.4250 3.0000
4.0000 7.7875 2.0000 4.0000 7.7875 2.0000
5.0000 8.1500 1.0000 5.0000 8.1500 1.0000
a=
>> c = a(3,:) 1.0000 6.7000 5.0000
c= 2.0000 7.0625 4.0000
3.0000 7.4250 3.0000 3.0000 7.4250 3.0000
4.0000 7.7875 2.0000
>> d = a([2:3],[1:3]) 5.0000 8.1500 1.0000
d=
2.0000 7.0625 4.0000
3.0000 7.4250 3.0000
>> f = e'
f=
1.0000 3.0000 5.0000
6.7000 7.4250 8.1500