is possible withdraw valour with problems of an matrix?

조회 수: 1 (최근 30일)
Carlos Batista
Carlos Batista 2014년 7월 17일
답변: Image Analyst 2014년 7월 17일
Hi users Matlab!!!
I have a doubt about the matrices (...)
I'd like to know if is possible withdraw valour with problems of an matrix (...)
For exemplo: I identified that an value of my matrix located from point [data(3,1) that have value of 9292983940] (...) This value is an erro and I can not use NaN for this value (...)
Is possible withdraw, only this value of my matrix. How I do?
Thanks! Carlos

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 17일
편집: Azzi Abdelmalek 2014년 7월 17일
If you have a vactor
A=[1 2 100 15]
You can delete the third element by
A(A==100)=[]
But if you have a matrix
A=[1 2;100 5]
A(A==100)=[]
The result will be a vector

Image Analyst
Image Analyst 2014년 7월 17일
Matrices must remain rectangular. If you have a bad value, you can identify the locations
badValue = 9292983940; % Whatever
badValueLocations = theMatrix == badValue;
But you can't just remove them since the matrix must remain rectangular. However you can set them to some other value such as 0 or nan;
theMatrix(badValueLocations) = 0; % or nan or whatever.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by