MATLAB Answers

simulering.m Line: 17 Column: 7 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

1 ビュー (過去 30 日間)
Magnus Poulsen
Magnus Poulsen 2019 年 12 月 2 日
Answered: Steven Lord 2019 年 12 月 2 日
clear all;
close all;
clc;
load('GaugeDataPart01.mat','INTtimeSERIE')
%konstanter
t=INTtimeSERIE(:,1);
i=(INTtimeSERIE(:,2)); %omregning fra mm/min til l/s/h
F_red=5.70492; %Ha
Q_ud=1*F_red; %l/s/Ha
alpha=0.76;
c=28070;
f=1;
for v_(size(t))=v_(size(t)-1)+f*i*F_red-Q_ud;
end
if v>=0
v=v(t-k)+f*i*F_red-Q_ud;
elseif v==0
v=0;
Q_ud=0;
end
plot(t,V(t))
datetick('x','mm-yy')
xlabel('dato')
ylabel('volumen [m^3]')

  0 件のコメント

サインイン to comment.

件の回答 (1)

Steven Lord
Steven Lord 2019 年 12 月 2 日
for v_(size(t))=v_(size(t)-1)+f*i*F_red-Q_ud;
That's not valid MATLAB syntax. It looks like you may be trying to create variables with sequentially numbered names (v1, v2, v3, ...) and if you are that's strongly discouraged. See this Answers post for some of the reasons why that's discouraged.
If you describe what exactly you're trying to do with that for statement we may be able to offer some suggestions. It may be as simple as calling cumsum to create a vector v, but I'm not certain.

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。

タグ

製品


リリース

R2019a

Translated by