How to use an output form simulink block as i/p in a for-loop matlab function call block without errors. ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
When I take continuous signal I/p from simulink block to use it in a for loop inside an m.file functional block code, then matlab prompts problem that (Index exceeds array dimensions. Index value 2 exceeds valid range [1-1] of array ADC_Va.) ADC_Va is the signal which I use as i/p in for loop matlab function call. for the first iteration it works but when loop increments then above messege prompts. anyone has any idea ?
0 Kommentare
Antworten (1)
Walter Roberson
am 8 Nov. 2018
Simulink signals have specific times associated with them, and at any one simulated time, only the signal value associated with that time is available to be read from the signal connection.
You would need to buffer the signal to however many steps you need to use the series of values in a for loop. That would of course introduce equivalent delay.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!