Page 1 of 1

USE MATLAB

Posted: Sun May 15, 2022 10:06 am
by answerhappygod
USE MATLAB
Use Matlab 1
Use Matlab 1 (36.57 KiB) Viewed 47 times
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