Question

The equation for a paraboloid (a 3D analogue of a parabola) is written: ?=?^2+?^2 Write a...

The equation for a paraboloid (a 3D analogue of a parabola) is written: ?=?^2+?^2 Write a MATLAB function(named “paraboloid”)that calculates z from x and y.Your function is tested in the script with the following:x=5, y=1; x=0, y=10; and x=-2, y=2.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Source code:

paraboloid.m : In matlab, function name and name of the .m file containing its definition must be same.

function z = paraboloid(x,y)
z = power(x,2) + power(y,2);
end

main.m : Script from which paraboloid function is to be called (Run this file)

z = paraboloid(5,1)
z = paraboloid(0,10)
z = paraboloid(-2,2)

Output:

Please refer to below screenshot to understand the indentation of source code:

paraboloid.m

Add a comment
Know the answer?
Add Answer to:
The equation for a paraboloid (a 3D analogue of a parabola) is written: ?=?^2+?^2 Write a...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT