Making a 1D array/vector from a table

19 visualizaciones (últimos 30 días)
Chris Dan
Chris Dan el 23 de En. de 2021
Editada: Ive J el 23 de En. de 2021
Hello,
I have this table or a 2D array
I want to seperate the numbers from the first column which have zero values in the third column. So in the end my result would be
x = [0; 0.0242; 0.3403]
Does anyone knows how it can be done ?

Respuesta aceptada

Ive J
Ive J el 23 de En. de 2021
Editada: Ive J el 23 de En. de 2021
X = cell2mat(X_cell); % X_cell: your original cell
myVec = X(X(:, 3) == 0, 1);

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by