11 views

Original Title: MATLAB 1 Solution.pdf

Uploaded by AbhiKhan

- AAE 320 - Introduction to PATRAN And
- En 808D Advanced Operating and Programming Turning 2013-09
- Relations and Functions
- imagine and shape
- Maths Ulangkaji
- 3D Geometry AIEEE Sheet
- Using WCS and the View Manager
- Matlab Portion for First Semester TA ZC164
- Trigo Functions
- matlab
- Pier Axis Definition in ETABS
- Ray Tracing_ the Rest of Your Life
- FORM 2.doc
- Dynamic-Simulator.pdf
- InstallMATLAB.pdf
- Using Multiple Measures
- activity4.pdf
- Sim u Link Example
- Informe Cub Ult
- Section A

You are on page 1of 7

Instructor: Prof. Antony Foster

Due Date: Month, xxth, 19xx

MATLAB ASSIGNMENT 1

Purpose: Using Matlab to create plots of single variable functions in the xy-plane

Commands Used:

linspace (a, b, n)

diff(f(x),k,x)

f = @(x,y,z,t,)vectorized expression

subs(expression)

plot (x,y,)

clear all

[a:b:c]

clc

clf reset

figure(k)

hold on/off

title('Your title','color','your color', 'FontName','Your

Font','FontWeight','bold','FontSize',12)

legend('String1','String2',,'Location', 'the location')

set(handle, other options)

set(gca, other options)

xlabel ('String', other options)

ylabel ('String', other options)

axis square/equal

axis([a, b, c, d])

grid on/off

derivative

on the same set of axes over the interval

marks should be at points with coordinates

and its

. The x-axis tick

.

MATLAB CODE

clear all

clc

% CLC clears the command window and homes the cursor.

domf = linspace (-pi, pi, 60); % Creates 60 linearly spaced point over the interval

domg = domf;

f = @(x) sin(x.^2).*cos(x);

dfx = diff(f(x),x);

g = @(x)subs(dfx);

%function g(x).

clf reset

% clear the current figure window and reset it to its default values.

figure(1)

hold on

PLOT2 = plot (domg, g(x));

hold off

title

sin(x)sin(x^2)','by','Foster,Antony'},'color','red','FontName','mathematica','FontWeight','bold','FontSize', 12)

legend ('f(x)','f'(x)','Location','NorthWest')

set (PLOT1,'Color','black','LineWidth','3','LineStyle','-')

set (PLOT2,'Color','red','LineWidth','3','LineStyle','-')

set (gca,'XTick', [-pi:pi/2:pi],'XMinorTick','on','XTickLabel', {'-pi','pi/2','0','pi/2','pi'},'FontName','mathematica','FontWeight','bold')

set(gca,'YTick',[-7:7],'YMinorTick','on','FontName','mathematica','FontWeight','bold')

xlabel ('X-Axis','Color','red','FontName','mathematica','FontWeight','bold','FontSize',12)

ylabel ('Y-Axis','Color','red','FontName','mathematica','FontWeight','bold','FontSize',12)

axis ( [-pi pi -7 7])

grid on

END OF CODE

by

Antony Foster

7

6

5

F(x)

F`(x)

4

3

Y-Axis

2

1

0

-1

-2

-3

-4

-5

-6

-7

-pi

-pi/2

X-Axis

pi/2

pi

and

on the interval

. Look up the axis command in Help to

see how to get the picture to actually look like a circle, rather than an ellipse.

MATLAB CODE

clear all

clc

GENERATING THE DATA TO BE PLOTTED

domf = linspace(-1, 1, 60);

domg = domf;

f =@(x)(1-x.^2).^(1/2);

% upper half of circle is the function f(x) = (1-x^2)^(1/2)

g = @(x)((1-x.^2).^(1/2)).*-1; % lower half of circle is the h(x) = -(1-x^2)^(1/2)

clf reset

figure(1)

PLOT1 = plot(domf,f(x));

hold on

PLOT2 = plot(domg,g(x) );

hold off

title({'Graph

1','by','Foster,Antony'},'Color','red','FontName','mathematica','FontWeight','bold','FontSize',12)

legend('sqrt(1-x^2)','-sqrt(1-x^2)','Location','NorthEastOutside')

set(PLOT1,'Color','black','LineWidth',3,'LineStyle',':')

set(PLOT2,'Color','black','LineWidth',3,'LineStyle','-')

set(gca,'XTick',[-1:1/2:1],'XMinorTick','on','XTickLabel',

{'-1','-1/2','0','1/2','1'},'FontName','mathematica','FontWeight','bold')

set(gca,'YTick',[-1:1/2:1],'YTickLabel',{'-1','-1/2','0','1/2','1'},

'YMinorTick','on','FontName','mathematica','FontWeight','bold')

xlabel('X-Axis','Color','red','FontName','mathematica','FontWeight',

'bold','FontSize',12)

ylabel('Y-Axis','Color','red','FontName','mathematica','FontWeight',

'bold','FontSize',12)

axis square equal

axis([-1

grid on

1 -1

1])

% makes a circle look round, instead of elliptical

% set the x- y- axis limits

% adds grid lines to plot

END OF CODE

2

by

Foster, Antony

1

sqrt(1-x 2 )

-sqrt(1-x 2 )

Y-Axis

1/2

-1/2

-1

-1

-1/2

1/2

X-Axis

- AAE 320 - Introduction to PATRAN AndUploaded byffefffe
- En 808D Advanced Operating and Programming Turning 2013-09Uploaded byFreddy Mamani Atayupanqui
- Relations and FunctionsUploaded byJustin Benitez
- imagine and shapeUploaded byDanielle Palmer
- 3D Geometry AIEEE SheetUploaded byAnuj
- Maths UlangkajiUploaded bychehor
- Using WCS and the View ManagerUploaded bymadmaxx42
- Matlab Portion for First Semester TA ZC164Uploaded byShaik Riyaz Peer
- Trigo FunctionsUploaded bymvmbapple
- matlabUploaded byvinoth
- Pier Axis Definition in ETABSUploaded bykiruba
- Ray Tracing_ the Rest of Your LifeUploaded byPhausRadek
- FORM 2.docUploaded bydirza82
- Dynamic-Simulator.pdfUploaded bytranhuutuong
- InstallMATLAB.pdfUploaded byataalp
- Using Multiple MeasuresUploaded byPavanReddyReddy
- activity4.pdfUploaded byUrsap Buddy
- Sim u Link ExampleUploaded bygsvijay57
- Informe Cub UltUploaded bymaycoling03
- Section AUploaded byMariamah Mary
- ViewUploaded byhalydia
- CalcIII_3DCoordsUploaded byjiksshav
- chapter 01Uploaded byapi-225960274
- Lecture 4 S16Uploaded bypascal joe
- MODULE 11- TansformationUploaded byidaman2905
- Trad.mecanica Electromecanica B5Uploaded byIulia Alina Anton
- Lecture on Introduction to MATLABUploaded byMani Mohan
- Using pano mapping table methodUploaded byPua Wee Shen
- Sectional Properties1Uploaded byShaharukh Khan
- Elmwood EUploaded byKonstantinos Konstantinou

- 0620 0653 0654 Chemistry Coursework Training Handbook Part 2 20Uploaded byCyn Wong
- How to Write Task 2, AcademicUploaded byAbhiKhan
- Green house effectUploaded byAbhiKhan
- IGCSE English Revision Guide CoreUploaded bytofunmiisaac
- O Level Chemistry NotesUploaded byabi_5dec94
- Edexcel M1 REVISION!Uploaded byAlexanderBrazdaLorente
- What is IELSTS?Uploaded byAbhiKhan
- New IELTS Writing Answer SheetUploaded byraaj22
- Solomon K MS - M1 Edexcel.pdfUploaded byAbhiKhan
- Solomon K MS - M1 EdexcelUploaded byAbhiKhan
- Academic Reading sample task Identifying informationUploaded byNguyễn Mỹ Hạnh
- 115017 Academic Reading Sample Task - Multiple ChoiceUploaded byrominabahar
- Math Jan 2009 MS S1Uploaded bydylandon
- WMA01_01_que_20170110Uploaded byAbhiKhan
- Writing TipsUploaded byAbhiKhan
- IAL(AS) Exam Routine May 2018.pdfUploaded byAbhiKhan
- centre-comms-ial-2018-transition-february-2018-update.pdfUploaded bymacgyver
- IAL(as) Exam Routine May 2018Uploaded byAbhiKhan
- A2 Physics Monthly Test January 2017Uploaded byAbhiKhan
- Aqa Gcse 9-1 Revision Guide PDFUploaded byAbhiKhan
- June 2016 (IAL) QP - C12 EdexcelUploaded byAbhiKhan
- CGP as Level Maths Revision and PracticeUploaded byAbhiKhan
- Physics Formula SheetUploaded byHannah K. Lee
- Formula SheetUploaded byLegacyGrade12
- chap1Uploaded byAbhiKhan
- AnandaLok_12th March 2013Uploaded byAbhiKhan

- Codigo m Filtro AdaptativoUploaded bymercielm
- Final Doc Cbir(Content Based Image Retrieval) in Matlab using Gabor WaveletUploaded bySatyam Yadav
- SeksGUI0.6 ManualUploaded byDamtoul
- Equivalence Between MATLAb and ScilabUploaded byshadowbraz
- Technical Computing Laboratory ManualUploaded byKarlo Untalan
- Matlab Parallel Computing ToolboxUploaded byGaurav Gupta
- ADAMS Matlab Co-simulation of an Exoskeleton for Lower LimbsUploaded bytyanfeng
- FiloG_ModellingFuzzyUploaded byali199013279254
- Genetic AlgorithmUploaded byNaman Taneja
- Build Mamdani Systems (Code) - MATLAB & Simulink - MathWorks IndiaUploaded byArsheel Khan
- Matlab TutorialUploaded bymanish kumar
- Ode With MatlabUploaded byleonelpm80
- Matlab_tutorialUploaded bySana Shah
- MatlabUploaded byp_odunga
- Machine Vision Toolbox for MATLAB.pdfUploaded byAnderson Henrique
- 59195Uploaded byRizky Wira Handalan
- CVX_ Matlab Software for Disciplined Convex Programming _ CVX Research, IncUploaded byOliver
- Simulink Tutorial - By tUploaded bymitev
- Pratical1_TRP_2013_2014Uploaded byAntónio Marques
- Matlab Fast 2012 FsuUploaded byjmorlier
- Simulink Importing Exporting to ExcelUploaded byfeyzafey
- Art. WF Assad - A Flexible Software Tool for Temporally-precise Behavioral Control in MatlabUploaded byPaul Rodrigo
- Matlab Ieee Project Topics 2015 and 2016Uploaded bysoftroniics
- Python-pres.pptxUploaded byagushatta
- methods based on linear experiment sampleUploaded byroquesa buray
- Matlab Real-time Trading PresentationUploaded byloafer555
- Pdf_eeglab Wiki TutorialUploaded byAhmed Rasel
- FPGA Implementation of Model PredictiveUploaded byislambenhamida
- Matlab Toolbox for High Resolution Vector Field Visualization with Application in Improving the Understanding of Crack Propagation Mechanisms, Nima Bigdely Shamlo master thesisUploaded bybigdelys
- Matconvnet ManualUploaded byFlorin Furculesteanu