select row and iterate for next rows
Mostrar comentarios más antiguos
I have 100 rows and 4 columns of data. I want to go row by row, extract data, assign each column for parameters and do calculation and store as output. Similarly, I need to select next rows and so on. From all outputs, I need to select the least value. For that least output, I need to get the row number also.
6 comentarios
Stephen23
el 2 de Ag. de 2016
@Venkatesh Baskaran: what is your question ?
Venkatesh Baskaran
el 2 de Ag. de 2016
Venkatesh Baskaran
el 2 de Ag. de 2016
@Venkatesh Baskaran: I know what your task is. I don't know what your question is.
A question starts with the words "why", "what", "how", etc., and has a question mark at the end. For example:
"How do I write nested loops in MATLAB?"
"What is the best way to solve this task?"
"Can someone please write some code for me?"
"I tried to do XXX, why does it give result YYY when I expect ZZZ?"
I have no idea what you are struggling with, because so far you have only told us what your task is. But you have not asked us anything.
Venkatesh Baskaran
el 2 de Ag. de 2016
Respuesta aceptada
Más respuestas (1)
Thorsten
el 2 de Ag. de 2016
If you want to multiply column 1 by alpha = 23 and add column 2, for example, you can to this as follows:
alpha = 23;
y = alpha*A(:,1) + A(:,2);
To find the minimum value and its index, use
[miny, idx] = min(y);
1 comentario
Venkatesh Baskaran
el 2 de Ag. de 2016
Categorías
Más información sobre Specialized Power Systems en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!