Create array u(i) that is max of array x(i) and y(i)
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Use the MATLAB environment to write an m-file that inputs a positive integer N and N-dimensional arrays x and y and generates a new N-dimensional array, u, defined as: u(i) = max(x(i), y(i)), i=1,2,...,N.
I'm new to MATLAB so I don't know how to set a multidimensional array to N through loops.
Answers (1)
Sean de Wolski
on 30 Apr 2013
Edited: Sean de Wolski
on 30 Apr 2013
x = rand(10,10,10);
y = rand(10,10,10);
mxy = max(x,y)
max() works directly on n-dimensional arrays.
doc max
Welcome to MATLAB and Answers.
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!