How do I create an array with the greatest values from two arrays?

조회 수: 2 (최근 30일)
Kylenino Espinas
Kylenino Espinas 2020년 11월 6일
댓글: Jon 2020년 11월 6일
function [semData] = semProcessing(raw1, raw2)
if length(raw1) = length(raw2)
lg = length(raw1);
semData = zeros(1,lg);
semData(1:end) = ;
end
end
semProcessing([1,3,5,7], [8,6,4,2])
Result: [8,6,5,7]
After doing this line of code I have an array that is filled with 0s and the same size as the two input arrays. How would I write a code that would get the result above?

채택된 답변

Jon
Jon 2020년 11월 6일
C = max(A,B)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by