Printing Certain Number from a Vector

2 visualizaciones (últimos 30 días)
Faris Amzar Mohamad Azrai
Faris Amzar Mohamad Azrai el 4 de Jun. de 2020
Comentada: Stephen23 el 4 de Jun. de 2020
Hello, can anyone help me? I want to print the numbers which is not 0 from this vector using fprintf. So, basically, i want to print out the numbers 1 and 10 in one line and in a vector form in the statement.
vector = [0 0 0 1 10];
fprintf(....)

Respuesta aceptada

KSSV
KSSV el 4 de Jun. de 2020
disp(vector(vector~=0))

Más respuestas (0)

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by