Operator '-' is not supported for operands of type 'timetable'.
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Nassim CHERIF
il 31 Mar 2022
Risposto: Cris LaPierre
il 31 Mar 2022
Operator '-' is not supported for operands of type 'timetable'.
Error in kppvg (line 23)
dist = sum((repmat(vc(i,:),nb_vD,1)-D).^2,2);%calcul dist^2
Error in main (line 53)
[ind_vp,dist_vp,c]=kppvg(X,Xtest,u(i),[1 2 3 4 5]);
hello, i have this problem when i excute my KNN program please can anyone help me :(
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/948334/image.png)
Risposta accettata
Cris LaPierre
il 31 Mar 2022
A timetable holds several variables of different data types. You must specify which variable in your timetable you want to subtract from.
See this page on how to Access Data in Tables
% Create the timetable
MeasurementTime = datetime({'2015-12-18 08:03:05';'2015-12-18 10:03:17';'2015-12-18 12:03:13'});
Temp = [37.3;39.1;42.3];
Pressure = [30.1;30.03;29.9];
WindSpeed = [13.4;6.5;7.3];
TT = timetable(MeasurementTime,Temp,Pressure,WindSpeed)
% Subtract from a variable in timetable TT
TT.Temp - 5
% Your error - subtract from timetable TT
TT - 5
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Tables in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!