i need a numbers in my answer
Medicion=get(handles.TablaMediciones,'data');
Resolucion=str2double(BibliotecaHerramientas(a,8));
Medicion=cellfun(@str2num,Medicion);
NoResolucion=mod(Medicion,Resolucion)
NoResolucion =
NaN NaN NaN NaN NaN

댓글 수: 4

Adam Danz
Adam Danz 2020년 1월 16일
What are Mes and Res?
Adam Danz
Adam Danz 2020년 1월 16일
편집: Adam Danz 2020년 1월 16일
It looks like you've edited the question and also provided the same code as an answer. Since the code was redundant, I removed it (I used a diff checker to confirm they were identical).
In order to help you, what are the values of Medicion & Resolucion (or whatever variable name they take)?
It's probably the case that one of the inputs is NaN. For example,
>> mod(1:5, nan)
ans =
NaN NaN NaN NaN NaN
>> mod(nan(1,5), 4)
ans =
NaN NaN NaN NaN NaN
Fernando Lucero
Fernando Lucero 2020년 1월 16일
편집: Fernando Lucero 2020년 1월 16일
this values are get from a table in guide, can be any value
for example.
Medicion=[{36},{36.1},{35.9},{36},{36.1}]
with
Resolucion={0.01}
Adam Danz
Adam Danz 2020년 1월 16일
편집: Adam Danz 2020년 1월 16일
No, those aren't the values of those two variables. If those two variables were cell arrays, you wouldn't get a vector of NaNs as output. You would get an error.
mod(num2cell(1:5),{5})
Undefined function 'mod' for input arguments of type 'cell'.
Even if they were vectors and not cell arrays, you would get 0s, not NaNs.
mod([36,36.1,35.9,36,36.1], 0.01)
ans =
0 0 0 0 0
So please take a closer look at those variable values that are being fed into mod().
Also, if those are the intended inputs to mod(), I'm curious what the goal is.

댓글을 달려면 로그인하십시오.

 채택된 답변

Fernando Lucero
Fernando Lucero 2020년 1월 16일

0 개 추천

the problem was
Resolucion=cell2mat(BibliotecaHerramientas(a,8));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by