How to get the required output?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
x=[4 5 1 2 3] & y=[6 7 8 9 10] and required output is c = [21 10]
3 Comments
madhan ravi
on 5 Nov 2018
why 21 and 10 ? mind explaining?
Image Analyst
on 5 Nov 2018
Here's one way
c = [sum(x)+y(1), y(end)];
It meets all your criteria that you've said so far. Here is another, simpler way
c = [21, 10];
It also meets your criteria and is even simpler because x and y were not even needed. If neither of those is good, then say why not.
Muniba Shah
on 6 Nov 2018
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!