How to use an output form simulink block as i/p in a for-loop matlab function call block without errors. ?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 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 Commenti
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!