MATLAB: Matlab how can I make this inequality I have an exercise that requires me to plot a function of y=x^2 from 0<=x<pi/2 what would be the right approach for this? Best Answer There are different ways to display a graph as you are asking, one of the most basic ones being1. define the base vectorstep=0.01x=[0:step:pi/2]2. define the functiony=x.^2;3. displayplot(x,y)grid oncomments:note the element wise operation implemented with the dot preceding the operator with '.^'plot has many optional fields, check MATLAB help for plotthe smaller the step the higher the resolutiongrid on is also optionalthe figure window has a marker that can be used for quick checks; at the end of a command line prevents MATLAB command window showing executionif you find these lines useful would you please mark my answer as Accepted Answer?To any other reader, if you find this answer of any help please click on the thumbs-up vote link,thanks in advance for time and attentionJohn BG<mailto:jgb2012@sky.com jgb2012@sky.com> Related SolutionsMATLAB: When should I post questions to Answers instead of the Newsgroup The big advantage of Answers is the ability to edit what you've posted. I use that feature a lot. MATLAB: How to plot a sym function with constant function such as x=2(vertical line) & y=3(horizontal line) syms x yeqn=yeqn1=xfplot(subs(eqn,y,3))hold onfplot(subs(eqn1,x,2)) Related QuestionNewsgroup or “Ask Question”What is differance between plot of a function and ezpolt of a function?And how can we achieve same plot by these twoWhy do answered questions get deletedAny way to use fplot to draw multiple curves in the same figureAnswers vs Newsgroup
Best Answer