Question

14. Practice questions a. Create an anonymous function called func1 for the dummy argument x that...

14. Practice questions

a. Create an anonymous function called func1 for the dummy argument x that finds the exponential of the negative one-half times the argument, and multiplies it by the sine of five times the argument. If given a vector or matrix, the function should perform element-by-element processing.

b. Using plot(), plot plotr -vs- func1(plotr) as a blue line. Then plot this same function again over the same range (0, 5) as a dashed red line using fplot(), keeping the original blue line. Label the x-axis "Plot Range", the y-axis "Function 1". Print the figure to a PDF called "Figure1.pdf". Please proof your answer on MATLAB

c.  indicate which of the names below are valid and appropriate variable names.

  • time-history

  • ALL&FILES

  • Velocity_6

  • DocList

  • exp
  • sys470_0

  • 68_degrees

  • @computers_list

Homework Answers

Answer #1

func1=@(x)exp(-x/2).*sin(5*x);
plotr=linspace(0,5,100);%replace this with your plotr vector
plot(plotr,func1(plotr),'b')
hold on
fplot(func1,[0,5],'r--')
xlabel('Plot Range')
ylabel('Function 1')
saveas(gcf,'Figure1.pdf')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%c%%%%%%%%%%%%%%%%%%%
time-history->Not appropriate,- not allowed

ALL&FILE->Not appropriate, & not allowed

Velocity_6-> appropriate

DocList -> appropriate

exp >appropriate
sys470_0 ->appropriate
68_degrees->->not appropriate
@computers_list->not appropriate

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT