Category: News
display the contents of the printt in a text area
hi, i want to display the contents of the printt in a text area
(THIS IS.AN EXAMPLE)
fprintf(" Sistema n.%d %s Ntrades diff %d n",i,string(predy.sis(i).Sistema),(predy.sis(i).Ntradess(end)-(predy.sis(i).NtradeLong(end)+predy.sis(i).NtradeShort(end))));
app.TextArea.Value=" " ??hi, i want to display the contents of the printt in a text area
(THIS IS.AN EXAMPLE)
fprintf(" Sistema n.%d %s Ntrades diff %d n",i,string(predy.sis(i).Sistema),(predy.sis(i).Ntradess(end)-(predy.sis(i).NtradeLong(end)+predy.sis(i).NtradeShort(end))));
app.TextArea.Value=" " ?? hi, i want to display the contents of the printt in a text area
(THIS IS.AN EXAMPLE)
fprintf(" Sistema n.%d %s Ntrades diff %d n",i,string(predy.sis(i).Sistema),(predy.sis(i).Ntradess(end)-(predy.sis(i).NtradeLong(end)+predy.sis(i).NtradeShort(end))));
app.TextArea.Value=" " ?? display the contents of the printt in a text area MATLAB Answers — New Questions
PV system not working after connecting to 9 bus network
Hello, how are you? I have a problem, I hope you’ll be able to help me.
The photovoltaic system circuit works normally when it works independently, but it does not work after the photovoltaic system is integrated with the 9-bus network, It does not respond, knowing that the sources are synchronous machines.Hello, how are you? I have a problem, I hope you’ll be able to help me.
The photovoltaic system circuit works normally when it works independently, but it does not work after the photovoltaic system is integrated with the 9-bus network, It does not respond, knowing that the sources are synchronous machines. Hello, how are you? I have a problem, I hope you’ll be able to help me.
The photovoltaic system circuit works normally when it works independently, but it does not work after the photovoltaic system is integrated with the 9-bus network, It does not respond, knowing that the sources are synchronous machines. asem alhayali MATLAB Answers — New Questions
Magic Formula in Multibody model
Hello,
I am using Magic Formula for contact forces in a Multibody Vehicle model (Simscape). The COG of vehicle is free to move about World Frame through a 6-DOF joint, where I kept the internal mechanics (stifness/damping to zero).
I have the following problem using Magic Formula. My body is bouncing to the ground the whole simulaiton time. Looking on the wheel forces through magic formula I get a sinus pfofile of Fz(front,rear) with not enough damping. Also after some time the front wheel Fz is to high that makes the front axle to bounce much and lose contact.
I tried to put some stifness and damping on the 6-DOF joint for Pz or change the .tir file vertical/stifness/damping. Only by giving a high Pz stifness to the joint makes the body move properly, however I see some weird response on the wheel Fz afterwards.
Could you please give me some advice or any ideas to solve that issue?Hello,
I am using Magic Formula for contact forces in a Multibody Vehicle model (Simscape). The COG of vehicle is free to move about World Frame through a 6-DOF joint, where I kept the internal mechanics (stifness/damping to zero).
I have the following problem using Magic Formula. My body is bouncing to the ground the whole simulaiton time. Looking on the wheel forces through magic formula I get a sinus pfofile of Fz(front,rear) with not enough damping. Also after some time the front wheel Fz is to high that makes the front axle to bounce much and lose contact.
I tried to put some stifness and damping on the 6-DOF joint for Pz or change the .tir file vertical/stifness/damping. Only by giving a high Pz stifness to the joint makes the body move properly, however I see some weird response on the wheel Fz afterwards.
Could you please give me some advice or any ideas to solve that issue? Hello,
I am using Magic Formula for contact forces in a Multibody Vehicle model (Simscape). The COG of vehicle is free to move about World Frame through a 6-DOF joint, where I kept the internal mechanics (stifness/damping to zero).
I have the following problem using Magic Formula. My body is bouncing to the ground the whole simulaiton time. Looking on the wheel forces through magic formula I get a sinus pfofile of Fz(front,rear) with not enough damping. Also after some time the front wheel Fz is to high that makes the front axle to bounce much and lose contact.
I tried to put some stifness and damping on the 6-DOF joint for Pz or change the .tir file vertical/stifness/damping. Only by giving a high Pz stifness to the joint makes the body move properly, however I see some weird response on the wheel Fz afterwards.
Could you please give me some advice or any ideas to solve that issue? magic formula, simscape, wheel forces MATLAB Answers — New Questions
how to get inverse ?
a = [1 2 3];
b = [3 2 1 ].’;
c = a*b;
aa = c*pinv(b) ;
i want to answer a = aa but i can’t
pleas~~~~a = [1 2 3];
b = [3 2 1 ].’;
c = a*b;
aa = c*pinv(b) ;
i want to answer a = aa but i can’t
pleas~~~~ a = [1 2 3];
b = [3 2 1 ].’;
c = a*b;
aa = c*pinv(b) ;
i want to answer a = aa but i can’t
pleas~~~~ inverse MATLAB Answers — New Questions
Polyspace unbalanced/nested critical sections
Hello,
I have a question regarding critical sections in the context of dynamic polyspace analysis (code-prover).
I have noticed that unbalanced locks for themselves appear not to create orange or red findings. Is this behavior intended?
BRHello,
I have a question regarding critical sections in the context of dynamic polyspace analysis (code-prover).
I have noticed that unbalanced locks for themselves appear not to create orange or red findings. Is this behavior intended?
BR Hello,
I have a question regarding critical sections in the context of dynamic polyspace analysis (code-prover).
I have noticed that unbalanced locks for themselves appear not to create orange or red findings. Is this behavior intended?
BR code prover, unbalanced locks, double locks MATLAB Answers — New Questions
How to convert the MATLAB code into the Python?
Hello,
I have a matlab code for the quantitative differential phase contrast imaging and the code is very big and complicated as well.
But the problem is the institute where I am working does not allow to use matlab and they have python and LabVIEW, so I would like to convert the matlab code to python or someone knows how to run the matlab code in python then it also be very helpful.
I have attached the main code.
Thank you.Hello,
I have a matlab code for the quantitative differential phase contrast imaging and the code is very big and complicated as well.
But the problem is the institute where I am working does not allow to use matlab and they have python and LabVIEW, so I would like to convert the matlab code to python or someone knows how to run the matlab code in python then it also be very helpful.
I have attached the main code.
Thank you. Hello,
I have a matlab code for the quantitative differential phase contrast imaging and the code is very big and complicated as well.
But the problem is the institute where I am working does not allow to use matlab and they have python and LabVIEW, so I would like to convert the matlab code to python or someone knows how to run the matlab code in python then it also be very helpful.
I have attached the main code.
Thank you. matlab to python, matlab python interface MATLAB Answers — New Questions
DOES Not match SHA256 hash of WinDev2407Eval.VMWare.zip
Get a Windows 11 development environment
https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/
DOES Not match the SHA256 hash of WinDev2407Eval.VMWare.zip
WELL ARE you recommend downloading to an internal HDD?
FOR THIS USED AN EXTERNAL USB STICK… Well? but not matching the sha256
Get a Windows 11 development environmenthttps://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ DOES Not match the SHA256 hash of WinDev2407Eval.VMWare.zipWELL ARE you recommend downloading to an internal HDD? FOR THIS USED AN EXTERNAL USB STICK… Well? but not matching the sha256 Read More
Fill color inside stair.
Hi all, I has two figures are plotted together. I want to fille colors within stairs but don’t know how to do.
figure;
h1 = histogram(data1, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h1.EdgeColor = ‘k’;
h1.LineWidth = 2;
% h1.FaceAlpha = 0.2;
hold on;
h2 = histogram(data2, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h2.EdgeColor = [0.772, 0.012, 0.314];
h2.LineWidth = 2;
% h2.FaceAlpha = 0.2; %
xlim([0 2]);
xticks(0:0.1:2);
% Customize font and frame properties
ax = gca;
ax.FontSize = 16;
ax.FontWeight = ‘bold’;
ax.LineWidth = 4;Hi all, I has two figures are plotted together. I want to fille colors within stairs but don’t know how to do.
figure;
h1 = histogram(data1, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h1.EdgeColor = ‘k’;
h1.LineWidth = 2;
% h1.FaceAlpha = 0.2;
hold on;
h2 = histogram(data2, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h2.EdgeColor = [0.772, 0.012, 0.314];
h2.LineWidth = 2;
% h2.FaceAlpha = 0.2; %
xlim([0 2]);
xticks(0:0.1:2);
% Customize font and frame properties
ax = gca;
ax.FontSize = 16;
ax.FontWeight = ‘bold’;
ax.LineWidth = 4; Hi all, I has two figures are plotted together. I want to fille colors within stairs but don’t know how to do.
figure;
h1 = histogram(data1, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h1.EdgeColor = ‘k’;
h1.LineWidth = 2;
% h1.FaceAlpha = 0.2;
hold on;
h2 = histogram(data2, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h2.EdgeColor = [0.772, 0.012, 0.314];
h2.LineWidth = 2;
% h2.FaceAlpha = 0.2; %
xlim([0 2]);
xticks(0:0.1:2);
% Customize font and frame properties
ax = gca;
ax.FontSize = 16;
ax.FontWeight = ‘bold’;
ax.LineWidth = 4; histogram MATLAB Answers — New Questions
Derivative of state is not finite (integrator error)
Hi,
I am currently feacing a problem with my simulink model. The model is a complex network where I need to calculate and pass mass flow and pressures through several subsystems. The model works fine for some situations, with spesific inputs (mass flows), but with large variation in the inputs I get the following error message:
I have tried a lot of differet approaches to resolve the problem, among other things;
Reduce the fixed step size.
Tightening the error tolerances.
Using unit delay block or a swich block.
Creating Self-Resetting integrators, but then this error occured: "State ports can only be used to break algebraic loops or to "hand-off " states between systems."
Using different solvers such as ode15s, ode45 and odeN.
This has worked for some situations, but then the error reoccurs with a different input later on.
The error occurs in the integrator block in the following subsystem:
I would really appreciate some guidance on this problem, it would really help me out a lot. Thank you in advance.Hi,
I am currently feacing a problem with my simulink model. The model is a complex network where I need to calculate and pass mass flow and pressures through several subsystems. The model works fine for some situations, with spesific inputs (mass flows), but with large variation in the inputs I get the following error message:
I have tried a lot of differet approaches to resolve the problem, among other things;
Reduce the fixed step size.
Tightening the error tolerances.
Using unit delay block or a swich block.
Creating Self-Resetting integrators, but then this error occured: "State ports can only be used to break algebraic loops or to "hand-off " states between systems."
Using different solvers such as ode15s, ode45 and odeN.
This has worked for some situations, but then the error reoccurs with a different input later on.
The error occurs in the integrator block in the following subsystem:
I would really appreciate some guidance on this problem, it would really help me out a lot. Thank you in advance. Hi,
I am currently feacing a problem with my simulink model. The model is a complex network where I need to calculate and pass mass flow and pressures through several subsystems. The model works fine for some situations, with spesific inputs (mass flows), but with large variation in the inputs I get the following error message:
I have tried a lot of differet approaches to resolve the problem, among other things;
Reduce the fixed step size.
Tightening the error tolerances.
Using unit delay block or a swich block.
Creating Self-Resetting integrators, but then this error occured: "State ports can only be used to break algebraic loops or to "hand-off " states between systems."
Using different solvers such as ode15s, ode45 and odeN.
This has worked for some situations, but then the error reoccurs with a different input later on.
The error occurs in the integrator block in the following subsystem:
I would really appreciate some guidance on this problem, it would really help me out a lot. Thank you in advance. integration, derivative, simulink, algebraic loop, error, model MATLAB Answers — New Questions
)neDrive-Personal in Taskbar
A rectangle with an icon and label OneDrive-Personal has just appeared toward the right side my taskbar.
Can’t find anything about it in TaskBar Settings or with Google Search.
Anybody know how to get rid of it?
A rectangle with an icon and label OneDrive-Personal has just appeared toward the right side my taskbar. Can’t find anything about it in TaskBar Settings or with Google Search. Anybody know how to get rid of it? Read More
Excel- auto formula
Hii,
Is it possible auto formula in excel, i want to sum 20 rows with the image i entered same formula, or any other formula or options??
Thank you
Hii, Is it possible auto formula in excel, i want to sum 20 rows with the image i entered same formula, or any other formula or options?? Thank you Read More
How to exclude a certain value from a range?
Suppose a variable has upper limit and lower limit of 1 and 54 [1 54] and I and to exclude one value say 30 from it. How to it?
For example:
a = [0 576;0 100; 0 140;0 100;0 550;0 100;0 410];
b = [0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1];
c = [0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1];
d = [0 20;0 20;0 20];
e = [2 7; 2 7; 2 7];
limit = [a;b;c;d;e]’;
In this case from e, I want to exclude the value 6.Suppose a variable has upper limit and lower limit of 1 and 54 [1 54] and I and to exclude one value say 30 from it. How to it?
For example:
a = [0 576;0 100; 0 140;0 100;0 550;0 100;0 410];
b = [0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1];
c = [0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1];
d = [0 20;0 20;0 20];
e = [2 7; 2 7; 2 7];
limit = [a;b;c;d;e]’;
In this case from e, I want to exclude the value 6. Suppose a variable has upper limit and lower limit of 1 and 54 [1 54] and I and to exclude one value say 30 from it. How to it?
For example:
a = [0 576;0 100; 0 140;0 100;0 550;0 100;0 410];
b = [0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1;0.95 1.1];
c = [0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1;0.9 1.1];
d = [0 20;0 20;0 20];
e = [2 7; 2 7; 2 7];
limit = [a;b;c;d;e]’;
In this case from e, I want to exclude the value 6. optimization, logical indexing, masking MATLAB Answers — New Questions
Any Idea Why I Keep Getting These When Outlook Starts
Microsoft® Outlook® 2021 MSO (Version 2407 Build 16.0.17830.20056) 32-bit
I keep getting various warnings when I start Outlook:
Any idea as to what is going on?
Microsoft® Outlook® 2021 MSO (Version 2407 Build 16.0.17830.20056) 32-bit I keep getting various warnings when I start Outlook: Any idea as to what is going on? Read More
Vlookup9
Sub santo()
Dim LastRow As Long
Set ws = Worksheets(“Customer”)
LastRow = Cells.Find(“*”, , xlValues, , xlRows, xlPrevious).Row
wrk = Array(Worksheets(“MIDDLE_INITIAL”), Worksheets(“LAST_NAME”))
na = Array(“old”, “new”)
a = Array(“I”, “J”, “K”, “F”)
For j = 0 To 1
For i = 0 To 2
With ws
.Range(a(i) & “1”).EntireColumn.Insert
If i > 1 Then
.Range(a(i) & “1”).Value = na(j) + ” ” + “Fullname”
For b = 2 To LastRow
ws.Cells(b, a(2)).Value = ws.Cells(b, a(3)).Value + ” ” + ws.Cells(b, a(0)).Value + ” ” + ws.Cells(b, a(1)).Value
Next b
Else
.Range(a(i) & “1”).Value = na(j) + ” ” + Sheets(3 + i).Name
.Range(a(i) & “2”, a(i) & LastRow) = Application.WorksheetFunction.VLookup(ws.Range(“B2:B” & LastRow), wrk(j).Range(“A:F”), (6 + i), False)
.Range(a(i) & “2”, a(i) & LastRow).Replace what:=”#N/A”, Replacement:=” “
End If
End With
Next i
a = Array(“M”, “N”, “O”, “L”)
Next j
End Sub
Sub santo()
Dim LastRow As Long
Set ws = Worksheets(“Customer”)
LastRow = Cells.Find(“*”, , xlValues, , xlRows, xlPrevious).Row
wrk = Array(Worksheets(“MIDDLE_INITIAL”), Worksheets(“LAST_NAME”))
na = Array(“old”, “new”)
a = Array(“I”, “J”, “K”, “F”)
For j = 0 To 1
For i = 0 To 2
With ws
.Range(a(i) & “1”).EntireColumn.Insert
If i > 1 Then
.Range(a(i) & “1”).Value = na(j) + ” ” + “Fullname”
For b = 2 To LastRow
ws.Cells(b, a(2)).Value = ws.Cells(b, a(3)).Value + ” ” + ws.Cells(b, a(0)).Value + ” ” + ws.Cells(b, a(1)).Value
Next b
Else
.Range(a(i) & “1”).Value = na(j) + ” ” + Sheets(3 + i).Name
.Range(a(i) & “2”, a(i) & LastRow) = Application.WorksheetFunction.VLookup(ws.Range(“B2:B” & LastRow), wrk(j).Range(“A:F”), (6 + i), False)
.Range(a(i) & “2”, a(i) & LastRow).Replace what:=”#N/A”, Replacement:=” “
End If
End With
Next i
a = Array(“M”, “N”, “O”, “L”)
Next j
End Sub Read More
Mail merge with excel
I have created a mail merge letter that is meant to merge in dates taken from my excel spreadsheet. I have in there a statement that says something like, The start date of this event is “Date” to “Date”. Another words, Begin Date and End Date. The problem I have is the end date will not display or print the end date as a date. It will only show or print as numbers representing the date. I have tried switches to no avail. I’m pulling my hair out here. Anyone know how to fix this. I have my dates in the decline formatted as date and switches attached to the mail merge fields. Just can’t get it to show the dates I so desperately need. HELP
CARL
I have created a mail merge letter that is meant to merge in dates taken from my excel spreadsheet. I have in there a statement that says something like, The start date of this event is “Date” to “Date”. Another words, Begin Date and End Date. The problem I have is the end date will not display or print the end date as a date. It will only show or print as numbers representing the date. I have tried switches to no avail. I’m pulling my hair out here. Anyone know how to fix this. I have my dates in the decline formatted as date and switches attached to the mail merge fields. Just can’t get it to show the dates I so desperately need. HELP CARL Read More
Why do agents trained by the reinforcement learning PPO algorithm get different results each time they load?
In the process of reinforcement learning, a problem will be encountered. During the training process, an effective agent will appear. At this time, the training will be finished in advance, but the result of the saved agent running out will be worseIn the process of reinforcement learning, a problem will be encountered. During the training process, an effective agent will appear. At this time, the training will be finished in advance, but the result of the saved agent running out will be worse In the process of reinforcement learning, a problem will be encountered. During the training process, an effective agent will appear. At this time, the training will be finished in advance, but the result of the saved agent running out will be worse problems in reinforcement learning training MATLAB Answers — New Questions
TRANSLATE() function not available in Excel
I would like to evaluate the new TRANSLATE function, but it is not available in my Excel.
My Specs:
Windows 11 ARM 64bit
Excel version 2409 Insider Beta Channel
OS and MS365 both fully updated.
I would like to evaluate the new TRANSLATE function, but it is not available in my Excel. My Specs:Windows 11 ARM 64bitExcel version 2409 Insider Beta ChannelOS and MS365 both fully updated. Read More
Help w. Word Template Formatting
i have a template and there is a final piece i am unable to move/work with in word
help!
i have a template and there is a final piece i am unable to move/work with in wordhelp! Read More
Visual Search Documentation
Looking at the Visual Search documentation I see there’s a filter for URL selection:
The KnowledgeRequest object includes the following fields:
filters — A Filter object that you use to filter the results.site — The site filter returns similar images and similar products results from the specified site only.
Is there a way to format this site filter key with multiple URLs? If I would like to search multiple sites for a visual search match, do I need to make multiple queries?
Looking at the Visual Search documentation I see there’s a filter for URL selection:The KnowledgeRequest object includes the following fields:filters — A Filter object that you use to filter the results.site — The site filter returns similar images and similar products results from the specified site only.documentation here Is there a way to format this site filter key with multiple URLs? If I would like to search multiple sites for a visual search match, do I need to make multiple queries? Read More
Closed loop with LSTM for time series
Dear All
I am in troubling trying to perform a multi-ahead (closed loop) forecasting for a time series. I use Matlab2024 and the "old" command predictAndUpdate does not work with dlnetwork objects. I saw all the possible documentation, theoretically I can manage the question but practically not!. I sum up the excercise. Single univariate time serie (stock price) in LSTM net. No problem with trainnet and predict using historical training and test data. Now I’d like to go out of test data. This is the code
X = (XTest);
T = YTest;
%net2 is a dlnetwork object
offset = length(X);
[Z,state] = predict(net2,X(1:offset)); %predict and update state using test data
net2.State = state;
% five-steps ahead
numPredictionTimeSteps = 5;
Y = (zeros(numPredictionTimeSteps));
Y(1,:) = Z(end); %use the last forecast as starting point for the loop
for t = 2:numPredictionTimeSteps
[Y(:,t),state] = predict(net2,Y(:,t-1));
net2.State = state;
end
%I got:
Error using extractState (line 41)
If the hidden state argument is a matrix, then its number of observations must match the number of observations of the
input data.
I found a similar question on the web for the GRU net. If I restart the net before the loop (as suggested) it works but the forecast is very poor, so I wonder whether the restart can affect such a result. Is there an alternative to reset? I attach the data and the net.
thanks in advanceDear All
I am in troubling trying to perform a multi-ahead (closed loop) forecasting for a time series. I use Matlab2024 and the "old" command predictAndUpdate does not work with dlnetwork objects. I saw all the possible documentation, theoretically I can manage the question but practically not!. I sum up the excercise. Single univariate time serie (stock price) in LSTM net. No problem with trainnet and predict using historical training and test data. Now I’d like to go out of test data. This is the code
X = (XTest);
T = YTest;
%net2 is a dlnetwork object
offset = length(X);
[Z,state] = predict(net2,X(1:offset)); %predict and update state using test data
net2.State = state;
% five-steps ahead
numPredictionTimeSteps = 5;
Y = (zeros(numPredictionTimeSteps));
Y(1,:) = Z(end); %use the last forecast as starting point for the loop
for t = 2:numPredictionTimeSteps
[Y(:,t),state] = predict(net2,Y(:,t-1));
net2.State = state;
end
%I got:
Error using extractState (line 41)
If the hidden state argument is a matrix, then its number of observations must match the number of observations of the
input data.
I found a similar question on the web for the GRU net. If I restart the net before the loop (as suggested) it works but the forecast is very poor, so I wonder whether the restart can affect such a result. Is there an alternative to reset? I attach the data and the net.
thanks in advance Dear All
I am in troubling trying to perform a multi-ahead (closed loop) forecasting for a time series. I use Matlab2024 and the "old" command predictAndUpdate does not work with dlnetwork objects. I saw all the possible documentation, theoretically I can manage the question but practically not!. I sum up the excercise. Single univariate time serie (stock price) in LSTM net. No problem with trainnet and predict using historical training and test data. Now I’d like to go out of test data. This is the code
X = (XTest);
T = YTest;
%net2 is a dlnetwork object
offset = length(X);
[Z,state] = predict(net2,X(1:offset)); %predict and update state using test data
net2.State = state;
% five-steps ahead
numPredictionTimeSteps = 5;
Y = (zeros(numPredictionTimeSteps));
Y(1,:) = Z(end); %use the last forecast as starting point for the loop
for t = 2:numPredictionTimeSteps
[Y(:,t),state] = predict(net2,Y(:,t-1));
net2.State = state;
end
%I got:
Error using extractState (line 41)
If the hidden state argument is a matrix, then its number of observations must match the number of observations of the
input data.
I found a similar question on the web for the GRU net. If I restart the net before the loop (as suggested) it works but the forecast is very poor, so I wonder whether the restart can affect such a result. Is there an alternative to reset? I attach the data and the net.
thanks in advance lstm closed loop MATLAB Answers — New Questions