Greetings,
I have a 32 variables containing 1000++ rows and a column containing area for each row. Can Matlab read and call a certain variable in the row and calculate area based on selected variable?

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2019년 7월 22일

0 개 추천

T = readtable('Book1.xlsx');
out = varfun(@sum,T,'g','Class_Name');

댓글 수: 2

nur afiqah
nur afiqah 2019년 7월 23일
Thank you for the answer, I've reffered to the function varfun and managed to get the answer.
What if we have multiple argument? (e.g.: total area for each class at specific distance provided) I attached the file for your perusal.
Your answer is very much appeciated!
T = readtable('Book2.xlsx');
out = varfun(@sum,T,'g',{'Class_Name','distance'});

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

추가 답변 (1개)

KSSV
KSSV 2019년 7월 22일

0 개 추천

Load the data from excel file using xlsread or readtable. Once you have data in workspace......you can get your desired result using some functions and indexing.

카테고리

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

제품

질문:

2019년 7월 22일

댓글:

2019년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by