Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
??? Field reference for multiple structure elements that is followed

Subject: ??? Field reference for multiple structure elements that is followed

From: lagas12@gmail.com

Date: 7 Aug, 2012 23:39:31

Message: 1 of 1

i have the folowing code
y = zeros(1,nt);
z = zeros(1,nt);
zz = zeros(ni,nt);
vv = zeros( nv,nt);
vis = zeros(nv,ni,nt);
X = zeros(1,nt);
qt = zeros(nv,ni,nt);
ql = zeros(ni,nt);
qlv = zeros(nv,nt);
II = zeros(1,nt);
III = zeros(ni,nt);
x = struct('y',y,'z',z,'II',II,'III',III,'zz',zz,'vv',vv,'qlv',...
    qlv,'x',X,'qt',qt,'ql',ql,'vis',vis);

function [ fct ] = fonctionobjectifv1(x)
%y,z,II,III,zz,vv,qlv )
load data.mat
fct=0
for t=1:nt
    fct=fct+(pf*x.y(t)+pu*x.X(t) + df*x.z(t)+ du*x.II(t)),
    for i= 1:ni
        fct=fct+(sf(i)*x.zz(i,t)+su(i)*x.III(i,t)),
    end
    for v=1:nv
        fct=fct+(tf(v)*x.vv(v,t)+tu(v)*x.qlv(v,t)),
    end
   
end

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us