Weird Port width mismatch error.
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I got the sollowing error:
Port width mismatch. Input 'signal' expects a signal of size [1.3608e+06x1]. The signal received is of size [1360800x1].
However, 1.3608e+06 is exactly 1360800. How to dispose the error message?
1 Kommentar
Paul
am 23 Jul. 2023
Hi Lorant,
Assuming this is Simulink, can you post a screen shot of the relevant portion of the model that's causing the error and the full text of the error message that comes up in the diagnostics window? Overlay the signal dimensions on the diagram from Debug -> Information Overlays.
Also, I wonder if there is a maximum allowable dimension for a signal. I coudn't find that info in the documentation.
Antworten (1)
Walter Roberson
am 21 Jul. 2023
A = 1.3608e+06
B = A+1
fprintf('A = %.4e\n', A)
fprintf('B = %.4e\n', B)
A == B
The two values both display as 1.3608e+06 but the values are not the same.
2 Kommentare
Walter Roberson
am 23 Jul. 2023
Does this happen to be for a MATLAB Function Block, or is the signal output of a MATLAB Function Block? And if so then is the size of the array being calculated in terms of an expression that involves either division or non-integer values ? For example 13608000*0.1 is not guaranteed to be exactly the integer 1360800
Siehe auch
Kategorien
Mehr zu String 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!