Basic equations from excel to matlab?

1 visualización (últimos 30 días)
Sha S
Sha S el 26 de Jun. de 2015
Comentada: Sha S el 26 de Jun. de 2015
Hi, I am a new matlab user. I have created equations on excel based on a data file. I have been able to successfully import this file into matlab and now I would like to use these same equations in matlab so that data processing will be quicker for each file. Each file has the same exact # of columns and a different number of rows.
This is one of the equations I have used on excel:
=((CI2+DP2)/2)+(0.4095*((DV2-(3.44/2))-((CI2+DP2)/2)))
This equation will be the same for each data file and it will be used for each row in the file. I realize that in matlab when I imported the file the columns changed into numbers rather than letter, sooo... CI= column 87, DP= column 120, DV= column 126.
Does anyone know how I would go about using this equation in matlab?

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 26 de Jun. de 2015
Editada: Azzi Abdelmalek el 26 de Jun. de 2015
If A is your matrix
A=rand(4,130), % Example
CI= 87,
DP=120,
DV=126
out=A(:,CI)+A(:,DP)/2+0.4095*(A(:,DV)-3.44/2)-(A(:,CI)+A(:,DP)/2)

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by