Question

I need help with these two Matlab question (1)Write a script that will 1. prompt the...

I need help with these two Matlab question

(1)Write a script that will
1. prompt the user for a maximum x value.
2. create an x vector from 1 to the user’s maximum in steps of 0.1
3. create a y vector which is sin(x)
4. plot the x and y vectors using blue *s, using appropriate x and y labels and a title

(2)Write a fives function that will receive two arguments for the number of rows and columns and will return
a matrix with that size of all fives.
Example:
>> fives(2,3)
[5 5 5
5 5 5]
>>

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

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

1)

clc%clears screen
clear all%clears history
close all%closes all files
format long
m=input('Enter maximum x value: ');
x=1:0.1:m
y=sin(x)
plot(x,y,'sb');
xlabel('x');
ylabel('y');
title('Plot of sin(x)');

Note: Brother According to Chegg's policy we are only allowed to answer first part if there are many. So, I request you to post other part as separate posts

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
I need help with these two Matlab question (1)Write a script that will 1. prompt the...
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
  • 10.) Write a MATLAB script that will use the Pressure and Temperature columns from the provided...

    10.) Write a MATLAB script that will use the Pressure and Temperature columns from the provided Excel file imported previously. Use polyfit to create a linear best fit line. Calculate the R2 value for fit. Plot both the individual data points (red) and the fit line (blue) on the same graph. Include a title and axis labels.

  • 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...

  • 3. Write a MATLAB script that does the following: elements equal to 3. colum ,. Creates...

    3. Write a MATLAB script that does the following: elements equal to 3. colum ,. Creates a matrix having 200 rows and 100 columns with al that are in both the last 50 rows and the Changes the elements in the matrix of part a last 50 columns from 3 to 5. . ur script should make MATLAB do the heavy lifting. This means there should be arn to tpe unfstle In order to enter your script into a text...

  • 1. Write a MATLAB function that takes a matrix, a row number and a scalar as...

    1. Write a MATLAB function that takes a matrix, a row number and a scalar as arguments and multiplies each element of the row of the matrix by the scalar returning the updated matrix. 2. Write a MATLAB function that takes a matrix, two row numbers and a scalar as arguments and returns a matrix with a linear combination of the rows. For example, if the rows passed to the function were i and j and the scalar was m,...

  • matlab script QUESTION 1 (1) Write a MATLAB script to find the standard deviation of integer...

    matlab script QUESTION 1 (1) Write a MATLAB script to find the standard deviation of integer numbers located in the vector a. Note that the vector contains both integer and floating- point numbers. The standard deviation formula is: 1 S = VN-12(%; – T)? use a-[6.6, 3, 8, 5, 8.8, 54, 78, 90, 5.5] the result should be

  • This question is for MATLAB. Write a script that continuously asks the user for a new...

    This question is for MATLAB. Write a script that continuously asks the user for a new sentence, until the user types the word "STOP". The program records all of the sentences the user wrote (not including "STOP") in a matrix with as many rows as needed but with an N number of columns. The user is prompted to provide N before typing in the first sentence. The output of the program is the array with the sentences in it, in...

  • Using Matlab or Octave, I do not know how to write the script for this problem,...

    Using Matlab or Octave, I do not know how to write the script for this problem, please help. Must match sample output 5. Consider a 3 x 3 matrix given by A = 01 012 013 az az 633 ( dai 632 033 The trace of A is defined as tr(A)=2au. Given another 3 x 3 matrix bu bı2 bia B- bi brz bra | bgi bz2 by it can be shown that trAB') = tr(AB). Write a script that...

  • Using Matlab; Please show written program to execute and instructions to create plot: 1. Create a...

    Using Matlab; Please show written program to execute and instructions to create plot: 1. Create a vector of x values from 0 to 20 pi, with an increment of pi/100. y=x sin (x) and z= x cos (x) a) create a figure window with two subplots. In first subplot create an x versus y plot and in the second subplot create an y versus z plot. b) create a polar plot of x and y. Add title and labels to...

  • MATLAB Only MATLAB Only MATLAB Only Indicated in the script below, write a function, called arbpoly3,...

    MATLAB Only MATLAB Only MATLAB Only Indicated in the script below, write a function, called arbpoly3, that accepts two inputs: i) a row vector, called c, containing the coefficients of the polynomial, starting with the coefficient for the lowest degree term, which is the constant term. ii) a row vector, called x, which is the set of real numbers where the polynomial is to be evaluated. The output, y, will be a vector containing the values of the polynomial, evaluated...

  • need help with matLab Question 1 (20 Points) Write a well-documented MATLAB script hmwk7Q1.m that simulates...

    need help with matLab Question 1 (20 Points) Write a well-documented MATLAB script hmwk7Q1.m that simulates tossing 100 coins into a unit square. As shown in the scatter plot. Location of Simulated Coins In Unit Square 1 o0 Ooo 05 04 03 02 oo 0.1 2 03 4 05 07 1 xpostion Hmwk7Q1.fig Consider organizing your MATLAB script into the following sections. % housekeeping (performs clearing of figures, workspace, and command lines) % Initialize the Number of Coins To Simulate...

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