Basic equations from excel to matlab?

1 次查看(过去 30 天)
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?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2015-6-26
编辑:Azzi Abdelmalek 2015-6-26
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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by