how to conver .csv data class from table to double

i have a two data in .csv format , i have import these data file in matlab and save these data in .mat from workspace . when i load these data in matlab there show class of data file (a & b ) is 'table' . when i performed mathmatecical operation in it's show "Undefined operator '+' for input arguments of type 'table' ". how i add these function and perform matmatical operation

 채택된 답변

Stephan
Stephan 2021년 1월 20일
편집: Stephan 2021년 1월 20일
If it is only numeric data and a and b are of the same dimensions this should work:
c = a{:,:} + b{:,:}
for example:
a1 = randi(10,5,1);
a2 = randi(10,5,1);
Ta = table(a1, a2)
b1 = randi(10,5,1);
b2 = randi(10,5,1);
Tb = table(b1, b2)
c = Ta{:,:} + Tb{:,:}
gives:
Ta =
5×2 table
a1 a2
__ __
2 9
9 7
6 4
6 6
2 5
Tb =
5×2 table
b1 b2
__ __
1 5
3 1
2 10
2 10
3 5
c =
3 14
12 8
8 14
8 16
5 10

댓글 수: 5

it's show the same problem
Undefined operator '+' for input arguments of type 'table'.
Error in Fopen (line 11)
c = a(:,:) + b(:,:);
this data a is 12000*1 table
and b is 12000*1 table
format this 'a' and 'b' in .mat format
What shows up for
A = table2array(a);
B = table2array(b);
whos A B
C = A + B;
By the way, consider using readmatrix() instead of readtable()
thank u sir..

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

태그

질문:

2021년 1월 20일

댓글:

2021년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by