Hi !
I was trying to use the function norm(v,p). but p takes value from 1 to inf.
How can I calulate the zero norm ?

 Accepted Answer

Nora Khaled
Nora Khaled on 1 May 2019
I used sum(x>0).

1 Comment

LANTIAN WEI
LANTIAN WEI on 6 Oct 2020
Edited: LANTIAN WEI on 6 Oct 2020
sum(abs(x)>0) will be better

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!