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?

 Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 22 de Jul. de 2019

0 votos

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

2 comentarios

nur afiqah
nur afiqah el 23 de Jul. de 2019
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!
Andrei Bobrov
Andrei Bobrov el 23 de Jul. de 2019
T = readtable('Book2.xlsx');
out = varfun(@sum,T,'g',{'Class_Name','distance'});

Iniciar sesión para comentar.

Más respuestas (1)

KSSV
KSSV el 22 de Jul. de 2019

0 votos

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.

Categorías

Productos

Preguntada:

el 22 de Jul. de 2019

Comentada:

el 23 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by