Command line2+3=5, try 3*2,12,2^3,2/1(d),3-2Inf,NAN try 0/1 1/0 13+inf 29/inf 0/0a=2 a=2; try a*7 chk a try a = a*7 chk aSquareroot=sqrt(4)//sin(x),sin(x*pi/180) x = i/p in radians //exp(x) try finding e and 1/edate,calendar
Commands try to change environmentwhoswhat , why ,clc-clear command window,clear - workspaceFunctions usually return with a valuedate ,help : functions
a,b scalarsx=0:10- vectors r generally ref as arrayssize(x) 1 row 11 columns,y=2.*x,z=y/2Try and see what happensx=0:0.1:10z=sin(x)plot(x,z),grid .1 ki jagah try .8 try sin(2*x)Tan(x),ezplot(‘tan(x)’)The TAB KEY HELP
x+2y=4,2x-y=3;Matrix approach=a=[1 2;2 -1];,b=[4;3];,x=ab;x=2,y=1Solve Function Approach=[x,y]=solve(‘x+2*y=4’,’2*x-y=3’)whos, workspace ko dekhox = double(x), y= double(y)whosFunction double converts x ( symbolic object data type to double array)
x+2*y % =4, 2*x –y % = 3 – Flag info on rt not part of commandhelp elfun,lookfor eigenvaluemagic square=magic(10)n*n magic square has a row and column sum n(n^2 + 1)/2contour(magic(22))heights above sea level of points on maps
Handel’s Hallelujah chorus:load handelsound(y,Fs)train,chirp,gong,laughter,splatEarth’s view from space:load earthimage(X);colormap(map);Capital X kyun hai?????????axis imageedit whyundock,dock current directory
M-file IntroductionC ki file likhte the turobo c me bas waisa hi hai bhiduIdhar apan log matlab ka prog m file me likhenger – plot will be red.m-script file or scriptcurrent directory test1type test1rt click,run,open,current directory folder
How a Program works in MATLAB?Interpreter= command line = lang which computer understandsFunda Simple hai : matlab ye ek interpreter hai!joh ap command line pe chalate ho who ye computer ko uski bhasha me samjha deta hai!Iske piche ka ek aur imp funda ye hai ki matlab ek nos and RAM ka khel khelta hai!woh particular no RAM ke particular ek memory location me store karegabalance = 1000no.1000 is allocated to mem location named balance in RAM
SUMMARYMATLAB is a matrix-based computer system designed toassist in scientific an engineering problem solving.To use MATLAB, you enter commands and statements onthe command line in the Command Window. They arecarried out immediately.quit or exit terminates MATLAB.clc clears the Command Window.
help and lookfor provide help.plot draws an x–y graph in a figure window.grid draws grid lines on a graph.
exerciseGive values to variables a and b on thecommand line, e.g. a = 3 and b = 5. Write some statements to find the sum,difference, product and quotient of a and b.