Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

MATLAB Commands and Syntax Examples, Study notes of Computer Science

Various examples of matlab commands and their corresponding output notes. It covers topics such as creating matrices, performing arithmetic operations, generating plots, and using functions. Students and researchers in engineering, physics, and mathematics may find this document useful for understanding the basics of matlab programming.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-owy-1
koofers-user-owy-1 🇺🇸

3

(1)

10 documents

1 / 3

Toggle sidebar

Related documents


Partial preview of the text

Download MATLAB Commands and Syntax Examples and more Study notes Computer Science in PDF only on Docsity! The Hot List command action ls doc clear ; % ... : ans pi Inf grid on help function name lookfor keyword whos cd pwd doc function name NaN eps plot(xlist, ylist) legend('text', 'text') title('text') xlabel('text') ylabel('text') axis([xmin xmax ymin ymax]) gtext('text') length(vectorname) size(matrixname) save filename load filename disp(varname) Commands Output Notes >> A = [1 2 3; 4 5 6; 7 8 9] >> a = 10 >> sin(a) >> format long >> sin(a) >> a = [1 2 3] >> b = [1; 2; 3] >> c = [1 2 3]' >> A = ones(5) >> B = ones (5,1) >> C = ones(1,5) >> A = eye(4) >> B = rand(6,2) >> C = zeros(2,5) >> a = 1:10 >> b = 1:0.5:10 >> c = linspace(1,10,3) >> A = ones(3,3) >> B = 2*ones(3,3) >> C = A*B >> D = inv(A)*B >> A = ones(3,3) >> b = rand(3,1) >> c = rand(1,3) >> A*b >> A*c >> A = 2*ones(3,2) >> B = [1 2; 3 4; 5 6] >> A*B >> A.*B >> A = [1 2 3; 4 5 6; 7 8 9] >> B = A(2,3) >> C = A(1:2, 1:3) >> D = A(5,5) >> A(5,5) = pi >> A = 2*ones(4) >> A^2 >> A.^2 >> A = [1 2 3; 4 5 6; 7 8 9] >> A(:) >> A = [1 2 3; 4 5 6; 7 8 9] >> a = [1 2 3] >> sum(A,1) >> sum(A,2) >> sum(a)
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved