Two variables concatenation to one in Simulink

2 visualizaciones (últimos 30 días)
MOUTAMANI NADIA
MOUTAMANI NADIA el 8 de Ag. de 2022
Comentada: MOUTAMANI NADIA el 11 de Ag. de 2022
Hello, I am trying to concatenate this 2 values A and B and send the resolution to C
Like if i have A=1111 and B=9999 i would like to have C=11119999,
is there a block that can do this, of a function i can use ?
Thanks in advance.

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Ag. de 2022
How do you want distinguish these cases:
A = 1234 B = 567
A = 123 B = 4567
What do you want to do if the values are negative? If A is positive and B is negative do you want (for example 1111-9999 as the result?
  1 comentario
MOUTAMANI NADIA
MOUTAMANI NADIA el 11 de Ag. de 2022
Thanks a lot for your response A & B are both positive numbers that don't exceed 9999
What i ended up doing is C=(A*10000)+B to have one value, that assures me that i will have A in the first 4 digits and B in the lasts.
With this i got what i wanted, but if there is a better method i am willing to try it, and thanks again.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by