How to use Find (or any other function) to create an Array
Ältere Kommentare anzeigen
Hi Everyone,
I have an array, S that appears as so:

And I want to Find the last place where a 1 occured. However, I essentially want to find the last place for each column (I am unsure of how to describe this)
I want my find to be as so:
Intervals = [1 1 1 1 1
3 2
4 ]
With using the max function I would like to create the array:
Max = [4 1 1 1 2]
The rows represent days and columns represent the replication - so essential I want to find the last day the replication achieved a 1.
Any help would be greatly appreciated even a push in the right direction :)
Akzeptierte Antwort
Weitere Antworten (1)
Alan Stevens
am 15 Nov. 2020
Here's another possible way
r = repmat((1:9)',1,5); max(r.*S_dash)
1 Kommentar
Lucinda Nott
am 17 Nov. 2020
Kategorien
Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!