Why does my Ps sequence block not work?

I need to set a repetitive signal. It needs to be a continous one. I have gathered 100 points (the max amount posible) and set the duration and output values. When I try to run it, an error comes up saying there´s something wrong with the dimensions. I have already check that there is the same amount of elements in each array. Any help please!

3 Commenti

@Adrián Jiménez, row and column vectors cannot be combined along certain dimensions without converting one to the other. This is seen in the message "Invalid concatenation along dimension 2 of value with size 1x1 to value with size 100x1." What is being attempted is to add 1 column (dimension 2) to the second value with size 100x1 but the first value size only has one row. So appearently either offset or t_duration aren't set correctly. This is the same in basic MATLAB:
firstv = rand(1,1);
secondv = rand(100,1);
size([firstv;secondv]) % is 101x1
size([firstv secondv']) % is 1x101
size([firstv secondv]) % gives a horzcat error
Okay, thank you Jeffrey. Now I try to turn the durations vector into a column and this is the error that comes up.
As you can see, I have already try to switch lines to columns to try to see if it works but it does not.
Jeffrey Clark
Jeffrey Clark il 7 Ott 2022
Modificato: Jeffrey Clark il 7 Ott 2022
@Adrián Jiménez, yes you can see that what it now thinks you are trying to do is fowling up something else and resulting in concatenating a 99x1 with a 1x1 and again along the column dimension. So perhaps you need to look at the documentation more closely and/or click on the Source Code link in the PS Repeating Sequence popup. Unfortunately I don't have Simulink so probably someone else needs to assist you in how to properly set the parameters.

Accedi per commentare.

Risposte (1)

Rishi
Rishi il 29 Set 2023
Hi Adrian,
I understand are facing an issue with setting the values of ‘Durations’ and ‘Start output values’ in the ‘Ps sequence block’. I tried entering two arrays with 100 elements each in these two fields, and my model runs without any error.
You can recheck your entries to these fields. If the issue persists, you can share your model.
Regards,
Rishi Shrimal

Categorie

Prodotti

Release

R2021b

Risposto:

il 29 Set 2023

Community Treasure Hunt

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

Start Hunting!

Translated by