USE MATLAB
those of vector v are: 5. Script m-file: Compare the Elements of Two Vectors of the Same Length a. Write an m-file that will compare two vectors, u Example: If u=[45, 23, 12] and and v, that are entered by the user. The vectors v=[30, 80, -15], the output should look like should have the same length. this: The m-file should ask the user to enter the two vectors, u and v (of The length of the vectors is 3. any length). The indices and values of elements in vector u that are greater than check that the vectors are the same length. o If the vectors are not the same length, the m- file should output that fact, and then end. If the two vectors are the same length output: - the length of each vector. b. Show your electronic file to the instructor for - the indices (element numbers) and values testing of the elements of u that are greater c. Print your completed m-file. than the corresponding elements in v. The output should be a 2D array, with the index numbers in the first column, and the values of u in the second column 1 45 3 12
USE MATLAB
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
USE MATLAB
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!