Effacer les filtres
Effacer les filtres

How to solve the Operator '-' is not supported for operands of type 'table'?

23 vues (au cours des 30 derniers jours)
clear all;
close all;
format long g;
%% Considering the 4corner or last column as z axis
z = LSinclination(:,5);
n = size(z,1);
% Computing the arithmetic mean or average value
%mean_value = mean(z);
intLogical = mod(LSinclination{:,5},1)==0 ;
mean_value= mean(LSinclination{intLogical,5});
% Computing the experimental variance and standard deviation
s2qk = sum((z-mean_value).^2)/(n-1);
sqk = sqrt(s2qk);
I have a data of laser scanner as attached and code file which shows some error mention in the comment. How can i fix it? Please explaing what does this error means?

Réponse acceptée

Duncan Po
Duncan Po le 14 Juin 2021
z should be a matrix instead of a table. z is defined using parentheses indexing in your code:
z = LSinclination(:,5);
This returns a table. Later on, you try to do math on z, and in general math on tables are not supported. Instead, you want to use braces indexing to extract the data as an array:
z = LSinclination{:,5};

Plus de réponses (0)


En savoir plus sur Parallel for-Loops (parfor) dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by