Printing Certain Number from a Vector

6 views (last 30 days)
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(....)

Accepted Answer

KSSV
KSSV on 4 Jun 2020
disp(vector(vector~=0))

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!