Question

USANUL OF THE SAM To Display wrong ant IF it is dispar M-five Narrabe s six digits.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the code for you:

variable = [1 2 3 4 5 6];

inputVariable = input('Enter the input variable: ');

if length(variable) == length(inputVariable)

fprintf('Right.\n');

else

fprintf('Wrong.\n');

end

And the output screenshot is:

MATLAB Window Help 뭔日@ 768.29 MB。< >乀令동啦) 99%顾_ Wed 12 Apr 03:25 ANANDA KUMAR THUMMAPUDI a E MATLAB R2013a EDITOR VIEW PLOTS

Add a comment
Know the answer?
Add Answer to:
How to write A MATLAB code stating that If the input in the command window is...
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
  • Please provide MATLAB code and comments! Please provide MATLAB code and comments! Please provide MATLAB code...

    Please provide MATLAB code and comments! Please provide MATLAB code and comments! Please provide MATLAB code and comments! Question #5. Write a script that creates a variable called BALANCE that is assigned the value 100.00. Then prompt the user to enter an amount to withdraw. Store that amount in a variable called WITHDRAW. Use an if/else construct to display a message to the user stating whether the withdrawal was successful. If the withdrawal would result in a negative balance, state...

  • 1) Write a MATLAB script to prompt a user to input two numbers, then assess whether...

    1) Write a MATLAB script to prompt a user to input two numbers, then assess whether the two numbers are equal or not. If the two numbers are equal, display that they are equal in the Command Window. If they are not equal, display that they are not equal in the Command Window. 2) Write a MATLAB script that prompts the user to enter the day of the week using the input function. If the information the user enters is...

  • Please show the code necessary, and explanations on MATLAB. Plotting 11) Plot the function y =...

    Please show the code necessary, and explanations on MATLAB. Plotting 11) Plot the function y = sin(x) from x = 0 to 21. 12) Plot the functions y = x2 z = x2 + 2x + 1 from x = 0 to 2 on the same graph. Scripts: Input and Output 13) Write a script (M-file) to read in a message at the command line using the MATLAB input function and then display the message to the Command Window using...

  • The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that...

    The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that will receive two function handles from elementary math functions which accept a vector to first sort in ascending order then calculate. The script will display the results in two separate Figure Windows with the function names in the title. Submit: fnfr_plot.m Browse My Computer Attach File QUESTION 4 Generate 1x100 random vector, x in the range of 0<x<100 by using rand. Input 2 elementary...

  • MATLAB scripts are how multiple lines of code can be executed vs. entering in a line...

    MATLAB scripts are how multiple lines of code can be executed vs. entering in a line of code one at a time through the command window. Write a script that does the following. Only display to the console window what is specified. Creates a 4 x 10 matrix with the 1strow being 1 to 10, the 2ndrow being 11 to 20, the 3rdrow being 21 to 30, and the last row being 31 to 40. The matrix is shown on...

  • MATLAB CODE. answer the following question in a driver in matlab please. 3. Write a for...

    MATLAB CODE. answer the following question in a driver in matlab please. 3. Write a for loop that calculates the first eleven values of the recursive sequence ak = -1(1 - ax-1), do = 10, and stores all eleven numbers in a vector. After the loop write a command to display the vector in the command window. Note that your loop does not need to compute do since this is given, and we should be the first entry in your...

  • Please use matlab cars. Answer: Function file; Command Window: 5.4 Write a user-defined function that plots...

    Please use matlab cars. Answer: Function file; Command Window: 5.4 Write a user-defined function that plots a circle given the coordinates of the center and the radius. For the function name and arguments use circleplot(x,y,R). The input arguments are the and y coordinates of the center and the radius. Use linspace to generte the angle from 0 to π with 100 points. (Hint: the circle equation: x+Rcos and yy-yRsin 0.) This function has no output arguments. Plot the circle using...

  • by matlab language please die b=5; h=3; a =(0.5) - b* Command Window a = 7.5000...

    by matlab language please die b=5; h=3; a =(0.5) - b* Command Window a = 7.5000 Home Work • 1. Some calculations on the command window. • 2. Create an M-file.

  • Complete the following problems in Matlab environment. Copy your com mand and final answer from MATLAB command window a...

    Complete the following problems in Matlab environment. Copy your com mand and final answer from MATLAB command window and paste them in a word document. Submit a single word document file for the entire HW Problems: Code your own MATLAB program to find the approximate value of the integral J e dr with Trapezoidal rule for N 20, .e., 2 (formula 4.21 on Page 201 YS). Also give the relative error of t2o with de-1. (Hint: For-end loops or Elementwise...

  • integers between 5 and 400 Use MATLAB command windows to create a vector with all a)...

    integers between 5 and 400 Use MATLAB command windows to create a vector with all a) Ans) "deconv" Write a function integerdivision to divide two polynomials function using the command b) d) Write m-file to find the roots of the following linear equation using MATLAB x5 +2x -5x3 +7x2+12x +200 Ans) Questions 2 cover CLO2:/10 a) Write the output of the following MATLAB code >> A = [2,4,10,13:16,3,7,18; 8,4,9,25:3,12,15,171 >> length (A) >> size (A)

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
ADVERTISEMENT