Window not accommodate my formulated analytical equations (Qy), it might go thousands, probably due to coded through sprintf; any assistance please
이전 댓글 표시
my code need alot of data to nonlinear equation,
function [FUN] = magige222(matr)
matL=abs(matr); [NodLp,pQ]=size(matr); data1=3; data2=data1+2-1; Nod3=NodLp-data1; p=pQ-1; nodes=9; LP=Nod3-nodes; JJ=NodLp-8+1; HLD=0; % matr loop eqns; not general matrix (MAG)
FUN = 'FUN=@(Qy)[';
for j=JJ:NodLp % looping headloses eqns
for k=1:p
if (sum(matL(j,1:k))<=sum(matL(j,1:p)))&&matL(j,k)~=0 FUN = [FUN, sprintf('(%d.*Qy(%d).*abs(Qy(%d)*8.*L(1,%d)*1./(9.81*3.14.^2.*D(1,%d).^5).*(0.25.*(log10(ee./(3.7.*D(1,%d))+2.51*3.14*vs.*D(1,%d)./(4.*Qy(%d)).*(0.25.*(log10(ee./(3.7.*D(1,%d))+2.51*3.14*vs.*D(1,%d)./(4.*Qy(%d)).*(0.25.*(log10(ee./(3.7.*D(1,%d))+2.51*3.14*vs.*D(1,%d)./(4.*Qy(%d)).*0.00001.^-0.5)).^-2).^-0.5)).^-2).^-0.5)).^-2)))+',matr(j,k),k,k,k,k,k,k,k,k,k,k,k,k,k)]; end
if (k==p) FUN = [FUN, sprintf('(%d);',matr(j,k+1))]; end
end
end
for j=data2:NodLp-8 % Nodal mass balance eqns
for k=1:p
if (sum(matL(j,1:k))<=sum(matL(j,1:p)))&&(matL(j,k)~=0) FUN = [FUN, sprintf('(%d.*Qy(%d))+',matr(j,k),k)]; end
if (k==p) FUN = [FUN, sprintf('(%d);',matr(j,k+1))]; end % FUN = [FUN, sprintf('matr(j,k+1);',j,k)]; end
end
end
FUN = [FUN, '(1.*Qy(1))+(-1.*Qy(2))+(0);(1.*Qy(2))+(-1.*Qy(3))+(-1.*Qy(9))+(-1.*Qy(15))+(-5.900000e-02);(1.*Qy(3))+(-1.*Qy(4))+(-1.*Qy(8))+(-5.900000e-02);(1.*Qy(4))+(1.*Qy(5))+(-1.*Qy(7))+(-1.780000e-01);(-1.*Qy(5))+(1.*Qy(6))+(-1.*Qy(11))+(-1.*Qy(12))+(-5.900000e-02);(1.*Qy(7))+(-1.*Qy(10))+(1.*Qy(11))+(-1.*Qy(13))+(-1.900000e-01);(1.*Qy(8))+(1.*Qy(9))+(1.*Qy(10))+(-1.*Qy(14))+(-1.780000e-01);(1.*Qy(14))+(1.*Qy(20))+(1.*Qy(21))+(-9.100000e-02);(1.*Qy(16))+(1.*Qy(19))+(-1.*Qy(20))+(0);(1.*Qy(15))+(-1.*Qy(16))+(1.*Qy(17))+(0);(1.*Qy(17))+(-1.*Qy(18))+(-3.000000e-02);(1.*Qy(18))+(-1.*Qy(19))+(-3.000000e-02);(1.*Qy(12))+(1.*Qy(13))+(-1.*Qy(21))+(0)];'];
end
the output those I got as executed the code
8.*L(1,70)*1./(9.81*3.14.^2.*D(1,70).^5).*(0.25.*(log... Output truncated. Text exceeds maximum line length for Command Window display.
댓글 수: 5
Eng. FM
2024년 5월 4일
Rik
2024년 5월 4일
I don't understand your question and I don't understand why on earth you are creating a char vector of a function. What is your end goal?
Also, you didn't @-mention Walter, so he may not notice this new question.
Eng. FM
2024년 5월 4일
Rik
2024년 5월 4일
What are you trying to do?
Eng. FM
2024년 5월 8일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Sparse Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!