Question

2.6) Mathlab Exercise 1. Create a row vector v with values (1, 2, 3, 5, 11,...

2.6) Mathlab Exercise
1. Create a row vector v with values (1, 2, 3, 5, 11, 7, 13).
2. Change the value of the 5th and the 6th element of the v to 7 and 11 respectively. Try doing this with only one command as well.
3. Create a vector Five5 out of all multiples of 5 that fall between 34 and 637. By the way, how many are they? (Tip: look up the command ”length” in help.)
4. Double click on the variable Five5 in the Workspace to inspect your results in the Variable Editor.
5. Can you use the colon operator to extract the numbers in the vector Five5 that are multiples of 5 only but not 10 ?

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

v = [1 2 3 5 11 7 13]
v([5 6]) = v([6 5])
Five5 = int16([]);
a= 1;
for n = 34:637
if(rem(n,5)==0)
Five5(a) = n;
a=a+1;
end
end
length(Five5)

Add a comment
Know the answer?
Add Answer to:
2.6) Mathlab Exercise 1. Create a row vector v with values (1, 2, 3, 5, 11,...
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
  • Can someone help me to solve it by Matlab? 7. Create a 5 row, 8 col...

    Can someone help me to solve it by Matlab? 7. Create a 5 row, 8 col matrix called mymat w ith random integers betwee n and including 70 and 90 Create a matrix from mymat called newmat whose entries consist of those entries which are both in the second and third rows, but also in the 4th through 6th columns 8. 9 What command would you type to list just the 4th row, 6th column entry of mymat? 1o. Crete...

  • second picture is output of the mathlab code Important Note: For testing of this part of the assignment, the automatic printing of values in the com mand window must not be used. Please make sure...

    second picture is output of the mathlab code Important Note: For testing of this part of the assignment, the automatic printing of values in the com mand window must not be used. Please make sure you put semicolon ω at the end of each line. For this part your program should perform following tasks 1. Create a Matrix A. Show the contents of matrix A to command window with the title Matrix A:". The Matrix A should be defined as...

  • on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A,...

    on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A, of matrix A is accesser (3) Correcting an entry is easy to (4) Any submatrix of Ais obtained by d row wise. Rows are separated by semicolons and columns are separated by spaces ner A l 23:45 6. B and hit the return/enter kry matrix A is accessed as A Enter and hit the returnerter key an entry is easy through indesine Enter 19...

  • Using c++ 1 of 2 Assignment 5 Lab Section 3 write a program create a vector...

    Using c++ 1 of 2 Assignment 5 Lab Section 3 write a program create a vector with random numbers. Use merge sort to reorder the vector Prompt user to enter a number to search in the vector. If there are more than one number in the vector equal to the search value, display the indices remove the repeated numbers. If found just one matching number, display the index. If no matching number, prompt user for 2 options: add to the...

  • Intro Step 11 We will be working with the following matrix [1 2 3 0 0...

    Intro Step 11 We will be working with the following matrix [1 2 3 0 0 0 0 2 1 2 3 0 0 0 3 2 1 2 3 0 0 0 3 2 1 2 3 0 0 0 3 2 1 2 3 0 0 0 3 2 1 2 0 0 0 0 3 2 1 0 0 0 0 0 3 2 0] 0 0 0 0 3 2 1 Use MATLAB to find the...

  • For this project, each part will be in its oun matlab script. You will be uploading a total 3 m f...

    For this project, each part will be in its oun matlab script. You will be uploading a total 3 m files. Be sure to make your variable names descriptive, and add comments regularly to describe what your code is doing and hou your code aligns with the assignment 1 Iterative Methods: Conjugate Gradient In most software applications, row reduction is rarely used to solve a linear system Ar-b instead, an iterative algorithm like the one presented below is used. 1.1...

  • A group of physics students collected data from a test of the projectile motion problem that...

    A group of physics students collected data from a test of the projectile motion problem that was analyzed in a previous lab exercise (L5). In their test, the students varied the angle and initial velocity Vo at which the projectile was launched, and then measured the resulting time of flight (tright). Note that tright was the dependent variable, while and Vo were independent variables. The results are listed below. (degrees) Time of Flight (s) Initial Velocity V. (m/s) 15 20...

  • These are my answere to the following questions: are they right? 1. B 2. T 3....

    These are my answere to the following questions: are they right? 1. B 2. T 3. T 4. T 5. F 6. T 7. A 8. D 9. E 10. B 11. B 12. A 13. A 14. D 15. C 16. D 17. T 18. C 19. T 20. T 21. T 22. A 23. T 24. D 25. B 26. A 27. A 28. A 29. T 30. C 31. D 32. A 33. T 34. F 35....

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