Question
If someone could explain and help me fix the part that show as
ans = 16
I dont get why that shows up and i have check the program already
19 grade = input (Error! Enter a valid grade: ); end fprintf(The valid grade enteres is: $1f\n, grade) $ Question 3 El fu
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Please put ; after function call to avoid getting ans = 16;

=================== modified matlab code =========================

%%%%% question 3%%%%%%%%%%
function [arovo] = rectareavol(length,width,height)
if nargin == 2
A = length * width;
arovo = fprintf('The area is [%d]\n',A);
else
A = length * width;
V = length * width * height;
arovo = fprintf('The Area is [%d] and the Volume is [%d]\n',A,V);
end
end

------------------------------------------------------------------------------------------------------------------------

Screenshots of the code and the output:

--------------------------------------------------------------------------------------------------------------------------

| | %%%%% question 3%%%%%%%%%% function [arovo] = rectareavol (length,width, height) if nargin == 2 A = length + width; arovo

>> [arovo] = rectareavol (2,2); The area is [4]

====================== end ===========================================

PLEASE LIKE THE POST   

Add a comment
Know the answer?
Add Answer to:
If someone could explain and help me fix the part that show as ans = 16...
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
  • I'm working on the newton's method on matlab, could someone help me and show what two...

    I'm working on the newton's method on matlab, could someone help me and show what two lines are needed to be added in the codes in order to make this function work? function sample_newton(f, xc, tol, max_iter) % sample_newton(f, xc, tol, max_iter) % finds a root of the given function f over the interval [a, b] using Newton-Raphson method % IN: % f - the target function to find a root of % function handle with two outputs, f(x), f'(x)...

  • Could you solve a part. Please please could you please solve i and ii could please clearly and co...

    Could you solve a part. Please please could you please solve i and ii could please clearly and correctly Length of plunger h Magnetie plunger Lossless N-turn coil Magnetic core Figure 2: Figure for Question 3. 3. (60 points) In the magnetic circuit in Figure 2, the moveable plunger of height h noves between two parallel core columns of width d, creating air gaps of lengths gi and 92 as shown (h 9.9 f the plunger position z where 0...

  • Can you please help me solve this question with its all the parts? (8%) Problem 9:...

    Can you please help me solve this question with its all the parts? (8%) Problem 9: The length of nylon rope from which a mountain climber is suspended has a force constant of 1.2 x 104N/m. > * 25% Part (a) What is the frequency, in Hz, at which he bounces, given his mass and the mass of his equipment is 84 kg? f=1 Grade Summary Deductions 0% Potential 100% sino 7 8 9 HOME JT ( E^^ 4 5...

  • please help! SHOW ALL WORK Can someone explain why for part b when I solve for the wavelength instead of 0.28 i get 2.81(im doing 2pi/k and have no clue why the answer is 0.28) Name Problem 4 Two...

    please help! SHOW ALL WORK Can someone explain why for part b when I solve for the wavelength instead of 0.28 i get 2.81(im doing 2pi/k and have no clue why the answer is 0.28) Name Problem 4 Two waves, one with wave function D0.250 sin(2.27x 16.71), and another with wave function D2 = 0.250 sin(2.27x + 16.70, interfere to form a wave with displacement D = Di D2-Note that aff values are in SI (mks) units and angles are...

  • please help me out and input values please .. main cpp.. please follow intructions exactly witj...

    please help me out and input values please .. main cpp.. please follow intructions exactly witj clarity please CSE 110-Intro to Computer Programming Project #3 Requirements-String Class Functions and Test Case Documentation Using the String Class, design and develop a multi-file password validation program and Test case Document (10% of grade) that requests a password, and validates it based on the following criteria. The password must be at least 8 characters long, contain at least one number, and at least...

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