Help me with Simulink function

1function M1 = fcn(lsecc,L,nelesecc,rsecc,ngdlglobal,ntotalsecc)
2M1=zeros(ngdlglobal,ngdlglobal);
3% x=zeros(ngdlglobal);
4i=0;
5for a=1:ntotalsecc
6 for b=1:nelesecc(a)
7 i=i+1;
8 M1=zeros(8);
9 M1(1,1)=156; M1(1,4)=-22*L(a); M1(1,5)=54; M1(1,8)=13*L(a);
10 M1(2,2)=156; M1(2,3)=22*L(a); M1(2,6)=54; M1(2,7)=-13*L(a);
11 M1(3,3)=4*L(a)^2; M1(3,6)=13*L(a); M1(3,7)=-3*L(a)^2;
12 M1(4,4)=4*L(a)^2; M1(4,5)=-13*L(a); M1(4,8)=-3*L(a)^2;
13 M1(5,5)=156; M1(5,8)=22*L(a);
14 M1(6,6)=156; M1(6,7)=-22*L(a);
15 M1(7,7)=4*L(a)^2;
16 M1(8,8)=4*L(a)^2;
17 for m=1:8
18 for n=m:8
19 M1(n,m)=M1(m,n);
20 end
21 end
22 end
23end
A error is: Size mismatch (size [:3136 x 1] ~= size [8 x 8]). The size to the left is the size of the left-hand side of the assignment.
Function 'MATLAB Function' (#48.190.192), line 8, column 7: "M1" Launch diagnostic report.

1 Comment

What are teh values of L, nelesecc,,ngdlglobal,ntotalsecc ?

Answers (0)

This question is closed.

Tags

Asked:

on 15 Mar 2017

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!