Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to do a matrix from vectors

1 Ansicht (letzte 30 Tage)
Valerio Gianforte
Valerio Gianforte am 21 Feb. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Good Afternoon,
I have to do a matrix starting from five vectors with the same dimensions but different class. Two vectors are "int32" and the other three are "single", when I do the matrix matlab converts the three vectors "single" to "int32" and approximates the values. Is there a way to convert "int32" or another way to do the matrix?
The first two vectors are "int32" while the last three are "single"
This is the method that I have adopted:
A = [time1 time2 Hs_buoy Tm_buoy Dm_buoy]

Antworten (2)

Matt J
Matt J am 21 Feb. 2020
One way,
A=cell2mat( cellfun(@single,{time1 time2 Hs_buoy Tm_buoy Dm_buoy},'uni',0) )

Fangjun Jiang
Fangjun Jiang am 21 Feb. 2020
A = [single([time1 time2]) Hs_buoy Tm_buoy Dm_buoy]

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by