Question

write a code that plots columns in a matrix one by one. while plotting, the code...

write a code that plots columns in a matrix one by one. while plotting, the code should allow 2 seconds to see each column plotted before moving to the other one. During those 2 seconds the user should have the ability to print the plotted vector by clicking it?

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

Here is the answer..........

#CODE:-

x=[1 2 3;4 5 6;7 8 9]%for matrix creation

hold on%this function for multiple plots

for i=1:3

plot(x(:,i))

pause(2)

end

hold off

for i=1:3

[x]=ginput(i)%this function for print the ploted vector

end

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
write a code that plots columns in a matrix one by one. while plotting, the code...
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
  • Write a code that plots the rows of a matrix (rows) one by one. after plotting...

    Write a code that plots the rows of a matrix (rows) one by one. after plotting eah vector, if you clicked the plot with the mouse it should store that row (array) in a new matrix. [MATLAB}

  • Write a code that comapres between the columns of two matrices. if there is a column...

    Write a code that comapres between the columns of two matrices. if there is a column shared between both matrices, it gets deleted from both of them. finally the code should print the two new matrices after the modification. [MATLAB] NOTE: SIZES Matrix 1 : 81 x 126 Matrix 2 : 81 x 94

  • Question 2 (d) Write equivalent code to the one shown below by replacing the while loop...

    Question 2 (d) Write equivalent code to the one shown below by replacing the while loop with a for loop while x <= 15 x=x+1; end [4 marks] (e) Write the small program from the previous question using a single line of code with vector operations. [2 marks] (f) Write a MATLAB script that uses a loop to print the contents of two vectors interleaved in to one vector. Assume both vectors are the same length. For example, if A...

  • A matrix named mach contains 3 columns of data concerning the energy output of several machines....

    A matrix named mach contains 3 columns of data concerning the energy output of several machines. The first column contains an ID code for a specific machine, the second column contains the total amount of energy produced by that machine in calories, and the third column contains the amount of time required by that machine to produce the energy listed in column 2 in hours. Write a MATLAB program that will: a) Request the user for the matrix mach. b)...

  • Please write in Java in Jgrasp check code before posting Please write in Java in Jgrasp...

    Please write in Java in Jgrasp check code before posting Please write in Java in Jgrasp check code before posting Please write in Java in Jgrasp check code before posting, will give thumbs up FOP- 2. Write a program that ciphers a plain text message using double transposition scheme and vice versa. [50 Marks) The program should accept five tuples of input: plain text, row, column, permutation of row and columns. An example of encrypted text for the plain text...

  • Write a new program called TrickOr Treat that will do the following 1. In a while...

    Write a new program called TrickOr Treat that will do the following 1. In a while loop, say "Trick or Treat!" and allow the user to type in the name of a candy and store it in an ArrayList. Once the user types "Trick", then the loop should stop. Then, print out the total number of candies on the screen. (See example below) [1 points] 2. Write a method called countSnickers that will take an ArrayList of candy as an...

  • n this exercise you are going to write all of your code in the main0 function....

    n this exercise you are going to write all of your code in the main0 function. Start, by creating an array of five chars, and a vector of five chars. Prompt the user to enter five characters for the array and read the characters into the array. Then prompt the user to enter 5 additional characters and read them into the vector. You should do the input with loops that count from 0 to 4. Finally, compare each element in...

  • Write a Java program that calculates the sum of a variable sized matrix using a two...

    Write a Java program that calculates the sum of a variable sized matrix using a two dimensional array. (ArraySum.java) The user should provide the number of rows and columns Test multiple user inputs (3 times 2, 4 times 4, 6 times 2, etc) A sum should be created for each row, each column, and the total for the matrix Ex.: How big would you like your matrix? Rows - ? 3 Columns -? 2 Please enter your row 1? Column...

  • WRITE CODE FOR NEXT 10 QUESTIONS USING THE IMAGE ABOVE !! 1.Create a matrix (called scores)...

    WRITE CODE FOR NEXT 10 QUESTIONS USING THE IMAGE ABOVE !! 1.Create a matrix (called scores) in the picture above, using MATRIX function. 2. Create a matrix (called scores) in the picture above, using RBIND function. 3. Create a matrix (called scores) in the picture above, using CBIND function. 4. Print out number 66 from the scores matrix. 5. Print out numbers number 16, 82, 85 from the scores matrix.  Hint: scores [ , 2] prints the numbers 55, 25, 18....

  • Problem 1 Write your code in the file MatrixOps.java. . Consider the following definitions from matrix...

    Problem 1 Write your code in the file MatrixOps.java. . Consider the following definitions from matrix algebra: A vector is a one-dimensional set of numbers, such as [42 9 20]. The dot product of two equal-length vectors A and B is computed by multiplying the first entry of A by the first entry of B, the second entry of A by the second entry of B, etc., and then summing these products. For example, the dot product of [42 9...

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