mod(x,y) function not found

2 Ansichten (letzte 30 Tage)
Fernando Lucero
Fernando Lucero am 16 Jan. 2020
Beantwortet: Fernando Lucero am 16 Jan. 2020
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 Kommentare
Fernando Lucero
Fernando Lucero am 16 Jan. 2020
Bearbeitet: Fernando Lucero am 16 Jan. 2020
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 am 16 Jan. 2020
Bearbeitet: Adam Danz am 16 Jan. 2020
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Fernando Lucero
Fernando Lucero am 16 Jan. 2020
the problem was
Resolucion=cell2mat(BibliotecaHerramientas(a,8));

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by