Tag Archives: matlab
Problem designing 150 MW 115 KV PV power plant
Hi,
I am trying to model a large PV farm with power rating of 150MW and Voltage rating of 115KV. I am taking "400KW grid connected PV Simulink Model" as a reference.The model used avergae model inverter and boost converter. But I am having hard time to design the boost converter where I plan to increase the voltage from 500V to 1500V approximately. I observed that the boost converter does not change the voltage above 700V. Can anyone help me with the problem? or Can anyone suggest me better reference model with which I can work on? It is crucial to highlight, the main objective is to convert the model to a RT-Lab model.
Thank You in advance.Hi,
I am trying to model a large PV farm with power rating of 150MW and Voltage rating of 115KV. I am taking "400KW grid connected PV Simulink Model" as a reference.The model used avergae model inverter and boost converter. But I am having hard time to design the boost converter where I plan to increase the voltage from 500V to 1500V approximately. I observed that the boost converter does not change the voltage above 700V. Can anyone help me with the problem? or Can anyone suggest me better reference model with which I can work on? It is crucial to highlight, the main objective is to convert the model to a RT-Lab model.
Thank You in advance. Hi,
I am trying to model a large PV farm with power rating of 150MW and Voltage rating of 115KV. I am taking "400KW grid connected PV Simulink Model" as a reference.The model used avergae model inverter and boost converter. But I am having hard time to design the boost converter where I plan to increase the voltage from 500V to 1500V approximately. I observed that the boost converter does not change the voltage above 700V. Can anyone help me with the problem? or Can anyone suggest me better reference model with which I can work on? It is crucial to highlight, the main objective is to convert the model to a RT-Lab model.
Thank You in advance. simulation, simulink MATLAB Answers — New Questions
Code problem of SVM in concrete regression
I am doing SVM learning, the code is
[Predict_1,error_1] = svmpredict(tn_train,pn_train,model);
[Predict_2,error_2] = svmpredict(tn_test,pn_test,model); taken from GitHub, but there are problems, mainly for this piece of code after running, it is empty setI am doing SVM learning, the code is
[Predict_1,error_1] = svmpredict(tn_train,pn_train,model);
[Predict_2,error_2] = svmpredict(tn_test,pn_test,model); taken from GitHub, but there are problems, mainly for this piece of code after running, it is empty set I am doing SVM learning, the code is
[Predict_1,error_1] = svmpredict(tn_train,pn_train,model);
[Predict_2,error_2] = svmpredict(tn_test,pn_test,model); taken from GitHub, but there are problems, mainly for this piece of code after running, it is empty set svm MATLAB Answers — New Questions
Code disappeared from App Designer
I have been working in the last months on a software interface in AppDesigner. I’m down to about 11,000 lines of code. Today, when I wanted to update, I opened the application and saw that the code was missing. All callbacks are gone, including StartupFcn. There are only a few lines of code specific to the axes and buttons in the interface.
If I open and run the code it does not work. If I run the mlapp file, it opens and does its job. But I don’t know where the code disappeared. Something like this happened to you ever???
Thanks!I have been working in the last months on a software interface in AppDesigner. I’m down to about 11,000 lines of code. Today, when I wanted to update, I opened the application and saw that the code was missing. All callbacks are gone, including StartupFcn. There are only a few lines of code specific to the axes and buttons in the interface.
If I open and run the code it does not work. If I run the mlapp file, it opens and does its job. But I don’t know where the code disappeared. Something like this happened to you ever???
Thanks! I have been working in the last months on a software interface in AppDesigner. I’m down to about 11,000 lines of code. Today, when I wanted to update, I opened the application and saw that the code was missing. All callbacks are gone, including StartupFcn. There are only a few lines of code specific to the axes and buttons in the interface.
If I open and run the code it does not work. If I run the mlapp file, it opens and does its job. But I don’t know where the code disappeared. Something like this happened to you ever???
Thanks! appdesigner, missing code, matlab, interface MATLAB Answers — New Questions
How to Output Scans to DAQ but Ignore Digital Outputs
Hello All,
I have a DAQ USB-6003 interfacing with Matlab. I currently have 1 analog input, 1 digital output, and 1 analog output. I understand that I can use ‘write’ command to output to the DAQ. However, because I have a digital output with no clock, it tells me that "on-demand" operations only are available for that channel.
Therefore, if I try to use an MxN scan matrix to send using the ‘write’ command, it throws an error (see image). I am wondering if there is a way to only output to the analog channel(s) and ignore the digital channel.
ThanksHello All,
I have a DAQ USB-6003 interfacing with Matlab. I currently have 1 analog input, 1 digital output, and 1 analog output. I understand that I can use ‘write’ command to output to the DAQ. However, because I have a digital output with no clock, it tells me that "on-demand" operations only are available for that channel.
Therefore, if I try to use an MxN scan matrix to send using the ‘write’ command, it throws an error (see image). I am wondering if there is a way to only output to the analog channel(s) and ignore the digital channel.
Thanks Hello All,
I have a DAQ USB-6003 interfacing with Matlab. I currently have 1 analog input, 1 digital output, and 1 analog output. I understand that I can use ‘write’ command to output to the DAQ. However, because I have a digital output with no clock, it tells me that "on-demand" operations only are available for that channel.
Therefore, if I try to use an MxN scan matrix to send using the ‘write’ command, it throws an error (see image). I am wondering if there is a way to only output to the analog channel(s) and ignore the digital channel.
Thanks daq MATLAB Answers — New Questions
Cannot run the compiled application
Hi,
I have a matlab code to analyze signal process. After I compiled the code by using application compiler, I faced an issue like below when I run the compiled .exe file.
"Invalid file identifier. Use fopen to generate a valid file identifier. Error in => main.m at line 194"
The wired thing is that I do not use fopen function and any files at line 194.
Could you suggest some ways to solve this issue?
Thank youHi,
I have a matlab code to analyze signal process. After I compiled the code by using application compiler, I faced an issue like below when I run the compiled .exe file.
"Invalid file identifier. Use fopen to generate a valid file identifier. Error in => main.m at line 194"
The wired thing is that I do not use fopen function and any files at line 194.
Could you suggest some ways to solve this issue?
Thank you Hi,
I have a matlab code to analyze signal process. After I compiled the code by using application compiler, I faced an issue like below when I run the compiled .exe file.
"Invalid file identifier. Use fopen to generate a valid file identifier. Error in => main.m at line 194"
The wired thing is that I do not use fopen function and any files at line 194.
Could you suggest some ways to solve this issue?
Thank you thingspeak MATLAB Answers — New Questions
Template matching between 1d frequency curves using normxcorr2
Hi,
I’m trying to use 2d cross correlation between 1d dimensional frequency curves (frequencies between 6000 and 22000 Hz) to find if a template curve is present in a test one which is bigger:
Template curve:
Test curve:
I’m willing to use two dimensional cross correlation between both curves using normxcorr2 but I’m not quite sure the most efficient way to do this.
I’ve tried to convert both curves to binary image arrays, and then applying nomxcorr2 using:
img_template=bsxfun(@eq, 1:22000,curve_template);
img_test=bsxfun(@eq, 1:22000,curve_test);
c=normxcorr2(img_template,img_test);
but this way the 2d arrays are huge (77×22000 and 5703×22000) and the results are difficult to plot ( because of memory issues) and so to analize:
figure;mesh(img_template’);hold on;
view([0 90]);
mesh(img_test);
figure;
surf(c)
Any clue on how to do this template matching between curves in a more efficcient way?Hi,
I’m trying to use 2d cross correlation between 1d dimensional frequency curves (frequencies between 6000 and 22000 Hz) to find if a template curve is present in a test one which is bigger:
Template curve:
Test curve:
I’m willing to use two dimensional cross correlation between both curves using normxcorr2 but I’m not quite sure the most efficient way to do this.
I’ve tried to convert both curves to binary image arrays, and then applying nomxcorr2 using:
img_template=bsxfun(@eq, 1:22000,curve_template);
img_test=bsxfun(@eq, 1:22000,curve_test);
c=normxcorr2(img_template,img_test);
but this way the 2d arrays are huge (77×22000 and 5703×22000) and the results are difficult to plot ( because of memory issues) and so to analize:
figure;mesh(img_template’);hold on;
view([0 90]);
mesh(img_test);
figure;
surf(c)
Any clue on how to do this template matching between curves in a more efficcient way? Hi,
I’m trying to use 2d cross correlation between 1d dimensional frequency curves (frequencies between 6000 and 22000 Hz) to find if a template curve is present in a test one which is bigger:
Template curve:
Test curve:
I’m willing to use two dimensional cross correlation between both curves using normxcorr2 but I’m not quite sure the most efficient way to do this.
I’ve tried to convert both curves to binary image arrays, and then applying nomxcorr2 using:
img_template=bsxfun(@eq, 1:22000,curve_template);
img_test=bsxfun(@eq, 1:22000,curve_test);
c=normxcorr2(img_template,img_test);
but this way the 2d arrays are huge (77×22000 and 5703×22000) and the results are difficult to plot ( because of memory issues) and so to analize:
figure;mesh(img_template’);hold on;
view([0 90]);
mesh(img_test);
figure;
surf(c)
Any clue on how to do this template matching between curves in a more efficcient way? template matching, image processing, normxcorr2 MATLAB Answers — New Questions
How do I reorder a regression plot in the desired sequence?
I am working on a set of datapoints like so:
x = [270 280 290 300 310 320 330 340 350 0 10 20 30 40 50 60 70 80 90]
y = [10000 9000 5500 2500 900 2500 5500 9000 10000 9000 5500 2500 900 2500 5500 9000 10000]
I have defined a sine^2(x) function with a phase shift of 45 degree, for fitting along these data points, because my data points are shifted that way.
I define x1 = 1:numel(x);
Using set(gca,’xTick’,x1,’XTickLabel’,x), I know that I can display in the x-axis order 270,…,0,…,90, without which I would get them in the x-axis order 0…90,…,270,…,350.
But, how do I apply that order for the fitting function itself? That doesn’t seem to work.
I attach the code for your reference.
function[]=plotdata(filename)
S = load(filename);
C = struct2cell(S);
M = cell2mat(C);
x = M(:,1)
y = M(:,end)
x1 = 1:numel(x);
mean(y)
xlocs = [270 0 90]
%freq = 1/(2*mean(diff(xlocs))) %diff(xlocs)
freq = 1 / (2*mean(diff(xlocs)))
[lb,ub] = bounds(y)
fcn = @(b,x)b(1).*cos(2*pi*x*b(2)+b(3)+(pi/4)).^2+b(4)
B0 = [ub-lb; freq; 0; lb]
myfun = @(b)norm(fcn(b,x) – y);
[B,fv] = fminsearch(myfun,B0)
xv = linspace(max(x),min(x),1000); %A smoother x vector
figure
plot(x, y, ‘*’, ‘DisplayName’,’Data’)
hold on
plot(xv, fcn(B,xv), ‘-r’, ‘DisplayName’,’Regression’)
hold off
%set(gca,’xTick’,x1,’XTickLabel’,x)
endI am working on a set of datapoints like so:
x = [270 280 290 300 310 320 330 340 350 0 10 20 30 40 50 60 70 80 90]
y = [10000 9000 5500 2500 900 2500 5500 9000 10000 9000 5500 2500 900 2500 5500 9000 10000]
I have defined a sine^2(x) function with a phase shift of 45 degree, for fitting along these data points, because my data points are shifted that way.
I define x1 = 1:numel(x);
Using set(gca,’xTick’,x1,’XTickLabel’,x), I know that I can display in the x-axis order 270,…,0,…,90, without which I would get them in the x-axis order 0…90,…,270,…,350.
But, how do I apply that order for the fitting function itself? That doesn’t seem to work.
I attach the code for your reference.
function[]=plotdata(filename)
S = load(filename);
C = struct2cell(S);
M = cell2mat(C);
x = M(:,1)
y = M(:,end)
x1 = 1:numel(x);
mean(y)
xlocs = [270 0 90]
%freq = 1/(2*mean(diff(xlocs))) %diff(xlocs)
freq = 1 / (2*mean(diff(xlocs)))
[lb,ub] = bounds(y)
fcn = @(b,x)b(1).*cos(2*pi*x*b(2)+b(3)+(pi/4)).^2+b(4)
B0 = [ub-lb; freq; 0; lb]
myfun = @(b)norm(fcn(b,x) – y);
[B,fv] = fminsearch(myfun,B0)
xv = linspace(max(x),min(x),1000); %A smoother x vector
figure
plot(x, y, ‘*’, ‘DisplayName’,’Data’)
hold on
plot(xv, fcn(B,xv), ‘-r’, ‘DisplayName’,’Regression’)
hold off
%set(gca,’xTick’,x1,’XTickLabel’,x)
end I am working on a set of datapoints like so:
x = [270 280 290 300 310 320 330 340 350 0 10 20 30 40 50 60 70 80 90]
y = [10000 9000 5500 2500 900 2500 5500 9000 10000 9000 5500 2500 900 2500 5500 9000 10000]
I have defined a sine^2(x) function with a phase shift of 45 degree, for fitting along these data points, because my data points are shifted that way.
I define x1 = 1:numel(x);
Using set(gca,’xTick’,x1,’XTickLabel’,x), I know that I can display in the x-axis order 270,…,0,…,90, without which I would get them in the x-axis order 0…90,…,270,…,350.
But, how do I apply that order for the fitting function itself? That doesn’t seem to work.
I attach the code for your reference.
function[]=plotdata(filename)
S = load(filename);
C = struct2cell(S);
M = cell2mat(C);
x = M(:,1)
y = M(:,end)
x1 = 1:numel(x);
mean(y)
xlocs = [270 0 90]
%freq = 1/(2*mean(diff(xlocs))) %diff(xlocs)
freq = 1 / (2*mean(diff(xlocs)))
[lb,ub] = bounds(y)
fcn = @(b,x)b(1).*cos(2*pi*x*b(2)+b(3)+(pi/4)).^2+b(4)
B0 = [ub-lb; freq; 0; lb]
myfun = @(b)norm(fcn(b,x) – y);
[B,fv] = fminsearch(myfun,B0)
xv = linspace(max(x),min(x),1000); %A smoother x vector
figure
plot(x, y, ‘*’, ‘DisplayName’,’Data’)
hold on
plot(xv, fcn(B,xv), ‘-r’, ‘DisplayName’,’Regression’)
hold off
%set(gca,’xTick’,x1,’XTickLabel’,x)
end curve fitting, reordering, plot MATLAB Answers — New Questions
ee_getpowerlossSummary function not giving results
I am trying to get power loss summary of my model which uses multiple mosfets. Due to the size of simulation I expected some calculation time would be taken however, I am not able to get switching loss or power dissipated values in output and the script stays stuck at Busy for hours. Although the function works perfectly fine when i am just calculating the powe loss without exposing the thermal port or when i expose thermal port of only few mosfets. But when i try using this with thermal port exposed for all mofets it stays stuck forever.I am trying to get power loss summary of my model which uses multiple mosfets. Due to the size of simulation I expected some calculation time would be taken however, I am not able to get switching loss or power dissipated values in output and the script stays stuck at Busy for hours. Although the function works perfectly fine when i am just calculating the powe loss without exposing the thermal port or when i expose thermal port of only few mosfets. But when i try using this with thermal port exposed for all mofets it stays stuck forever. I am trying to get power loss summary of my model which uses multiple mosfets. Due to the size of simulation I expected some calculation time would be taken however, I am not able to get switching loss or power dissipated values in output and the script stays stuck at Busy for hours. Although the function works perfectly fine when i am just calculating the powe loss without exposing the thermal port or when i expose thermal port of only few mosfets. But when i try using this with thermal port exposed for all mofets it stays stuck forever. simulink, simscape, power_electronics_control MATLAB Answers — New Questions
Numerical Derivative Approximations Using MATLAB?”
i have used taylor series to find the first derivative of the following function F and got 2 diffrent approximations ,
i wanted to check which one has a lower error more precision from the 2 approximations,
i started by understanding how to graph the function and its derviative wrote the 2 expressions i got , then tried to graph each graphs error , i have not yet added axis names and so on , but i reached a certain place where i am not sure if the first approximation values do indeed make sense i expected a diffrent graph , secondly i was asked to do a log log graph to comapre the errors but the values i got were already, straight lines so i seem to be missing something here is the code for now
we were asked to look at h between 10^-1 to 10^-15 did not specifiy how many look at probable this is one of the reasons that i would have beem able to use log log if i kept the x axis 10^-15 to 10^-1 and not set 20 numbers in the set
,thanks for the guidness in advance
%testing a bit too far
f = @cos;
x = 1;
h=0:0.1:8*pi;
plot(x+h,f(x+h),’*’,x-h,f(x-h),’*’)
d_f =@(x) -sin(x);
exact = d_f(x);
h=0:0.1:8*pi;
hold on
plot(x+h,d_f(x+h),’*’,x-h,d_f(x-h),’*’)
exact = d_f(x);
hold off
d_f(1)
f(1)
%testing near the point of interest
h2=0:0.001:10^-2
plot(x+h2,f(x+h2),’*’,x-h2,f(x-h2),’*’)
plot(x+h2,d_f(x+h2),’*’,x-h2,d_f(x-h2),’*’)
%indentifying the appoximations we got
approx_1=@(f, x, h) (f(x + h) – f(x)) / h;
approx_2=@(f, x, h) (f(x + h) – f(x-h)) / (2*h);
d_f(1)
h = linspace(10^-15,10^-1,20)
plot(x+h,approx_1(f,x,h),’*’,x-h,approx_1(f,x,-h),’*’)
plot(x+h,approx_2(f,x,h),’*’,x-h,approx_2(f,x,-h),’*’)
v_1_up=approx_1(f,x,h)-d_f(1)
v_2_up=approx_2(f,x,h)-d_f(1)
v_1_down=approx_1(f,x,-h)-d_f(1)
v_2_down=approx_2(f,x,-h)-d_f(1)
plot(h,v_1_up,’*’,h,v_1_down,’*’)
plot(h,v_2_up,’*’,h,v_2_down,’*’)i have used taylor series to find the first derivative of the following function F and got 2 diffrent approximations ,
i wanted to check which one has a lower error more precision from the 2 approximations,
i started by understanding how to graph the function and its derviative wrote the 2 expressions i got , then tried to graph each graphs error , i have not yet added axis names and so on , but i reached a certain place where i am not sure if the first approximation values do indeed make sense i expected a diffrent graph , secondly i was asked to do a log log graph to comapre the errors but the values i got were already, straight lines so i seem to be missing something here is the code for now
we were asked to look at h between 10^-1 to 10^-15 did not specifiy how many look at probable this is one of the reasons that i would have beem able to use log log if i kept the x axis 10^-15 to 10^-1 and not set 20 numbers in the set
,thanks for the guidness in advance
%testing a bit too far
f = @cos;
x = 1;
h=0:0.1:8*pi;
plot(x+h,f(x+h),’*’,x-h,f(x-h),’*’)
d_f =@(x) -sin(x);
exact = d_f(x);
h=0:0.1:8*pi;
hold on
plot(x+h,d_f(x+h),’*’,x-h,d_f(x-h),’*’)
exact = d_f(x);
hold off
d_f(1)
f(1)
%testing near the point of interest
h2=0:0.001:10^-2
plot(x+h2,f(x+h2),’*’,x-h2,f(x-h2),’*’)
plot(x+h2,d_f(x+h2),’*’,x-h2,d_f(x-h2),’*’)
%indentifying the appoximations we got
approx_1=@(f, x, h) (f(x + h) – f(x)) / h;
approx_2=@(f, x, h) (f(x + h) – f(x-h)) / (2*h);
d_f(1)
h = linspace(10^-15,10^-1,20)
plot(x+h,approx_1(f,x,h),’*’,x-h,approx_1(f,x,-h),’*’)
plot(x+h,approx_2(f,x,h),’*’,x-h,approx_2(f,x,-h),’*’)
v_1_up=approx_1(f,x,h)-d_f(1)
v_2_up=approx_2(f,x,h)-d_f(1)
v_1_down=approx_1(f,x,-h)-d_f(1)
v_2_down=approx_2(f,x,-h)-d_f(1)
plot(h,v_1_up,’*’,h,v_1_down,’*’)
plot(h,v_2_up,’*’,h,v_2_down,’*’) i have used taylor series to find the first derivative of the following function F and got 2 diffrent approximations ,
i wanted to check which one has a lower error more precision from the 2 approximations,
i started by understanding how to graph the function and its derviative wrote the 2 expressions i got , then tried to graph each graphs error , i have not yet added axis names and so on , but i reached a certain place where i am not sure if the first approximation values do indeed make sense i expected a diffrent graph , secondly i was asked to do a log log graph to comapre the errors but the values i got were already, straight lines so i seem to be missing something here is the code for now
we were asked to look at h between 10^-1 to 10^-15 did not specifiy how many look at probable this is one of the reasons that i would have beem able to use log log if i kept the x axis 10^-15 to 10^-1 and not set 20 numbers in the set
,thanks for the guidness in advance
%testing a bit too far
f = @cos;
x = 1;
h=0:0.1:8*pi;
plot(x+h,f(x+h),’*’,x-h,f(x-h),’*’)
d_f =@(x) -sin(x);
exact = d_f(x);
h=0:0.1:8*pi;
hold on
plot(x+h,d_f(x+h),’*’,x-h,d_f(x-h),’*’)
exact = d_f(x);
hold off
d_f(1)
f(1)
%testing near the point of interest
h2=0:0.001:10^-2
plot(x+h2,f(x+h2),’*’,x-h2,f(x-h2),’*’)
plot(x+h2,d_f(x+h2),’*’,x-h2,d_f(x-h2),’*’)
%indentifying the appoximations we got
approx_1=@(f, x, h) (f(x + h) – f(x)) / h;
approx_2=@(f, x, h) (f(x + h) – f(x-h)) / (2*h);
d_f(1)
h = linspace(10^-15,10^-1,20)
plot(x+h,approx_1(f,x,h),’*’,x-h,approx_1(f,x,-h),’*’)
plot(x+h,approx_2(f,x,h),’*’,x-h,approx_2(f,x,-h),’*’)
v_1_up=approx_1(f,x,h)-d_f(1)
v_2_up=approx_2(f,x,h)-d_f(1)
v_1_down=approx_1(f,x,-h)-d_f(1)
v_2_down=approx_2(f,x,-h)-d_f(1)
plot(h,v_1_up,’*’,h,v_1_down,’*’)
plot(h,v_2_up,’*’,h,v_2_down,’*’) plot, data MATLAB Answers — New Questions
How to read an excel /csv files with columns that have both text and numbers?
Everytime I try to use readcell , readtable.. I get one or alll of the following problems:
Numeric columns get merged into one cell array ex : {1.5,2.5} vs them being in two unique cells
Additional columns that dont exist in my csv/xlsx files with 1×1 missing filled in
Nan for string entries
I saw online that a column with text and numeric values dont mix well. Anyone have any suggestions?
I am also trying to find a specific string value index (xdist_mm,Power_watts) for each file to then import the data under each of these headers into a seperate array for analysis. I tried strfind and contains without much sucess)
Thank youEverytime I try to use readcell , readtable.. I get one or alll of the following problems:
Numeric columns get merged into one cell array ex : {1.5,2.5} vs them being in two unique cells
Additional columns that dont exist in my csv/xlsx files with 1×1 missing filled in
Nan for string entries
I saw online that a column with text and numeric values dont mix well. Anyone have any suggestions?
I am also trying to find a specific string value index (xdist_mm,Power_watts) for each file to then import the data under each of these headers into a seperate array for analysis. I tried strfind and contains without much sucess)
Thank you Everytime I try to use readcell , readtable.. I get one or alll of the following problems:
Numeric columns get merged into one cell array ex : {1.5,2.5} vs them being in two unique cells
Additional columns that dont exist in my csv/xlsx files with 1×1 missing filled in
Nan for string entries
I saw online that a column with text and numeric values dont mix well. Anyone have any suggestions?
I am also trying to find a specific string value index (xdist_mm,Power_watts) for each file to then import the data under each of these headers into a seperate array for analysis. I tried strfind and contains without much sucess)
Thank you readtable, readcell MATLAB Answers — New Questions
How read in simulink model value of E2E Transformer error?
Hello,
How read in simulink model value of transformerError_Input where E2E Transformer write value of error?
In help Configure AUTOSAR Sender-Receiver Communication – MATLAB & Simulink (mathworks.com) it is describe that:
The generated C code contains RTE read and write API calls that pass the transformer error argument.
void Runnable(void)
{
Rte_TransformerError transformerError_Input;
float64 tmpRead;
…
/* Inport: ‘<Root>/Input’ */
Rte_Read_RPort_InputDE(&tmpRead, &transformerError_Input);
…
/* Outport: ‘<Root>/Output’… */
(void) Rte_Write_PPort_OutputDE(data, &transformerError_Input);
…
}
I see in generated C code that it is created local variable transformerError_Input but i don’t know where in simulink model there is an equivalent of transformerError_Input.
For example:
If i need to rewrite the value from local variable transformerError_Input, how can i do it in simulnik model.Hello,
How read in simulink model value of transformerError_Input where E2E Transformer write value of error?
In help Configure AUTOSAR Sender-Receiver Communication – MATLAB & Simulink (mathworks.com) it is describe that:
The generated C code contains RTE read and write API calls that pass the transformer error argument.
void Runnable(void)
{
Rte_TransformerError transformerError_Input;
float64 tmpRead;
…
/* Inport: ‘<Root>/Input’ */
Rte_Read_RPort_InputDE(&tmpRead, &transformerError_Input);
…
/* Outport: ‘<Root>/Output’… */
(void) Rte_Write_PPort_OutputDE(data, &transformerError_Input);
…
}
I see in generated C code that it is created local variable transformerError_Input but i don’t know where in simulink model there is an equivalent of transformerError_Input.
For example:
If i need to rewrite the value from local variable transformerError_Input, how can i do it in simulnik model. Hello,
How read in simulink model value of transformerError_Input where E2E Transformer write value of error?
In help Configure AUTOSAR Sender-Receiver Communication – MATLAB & Simulink (mathworks.com) it is describe that:
The generated C code contains RTE read and write API calls that pass the transformer error argument.
void Runnable(void)
{
Rte_TransformerError transformerError_Input;
float64 tmpRead;
…
/* Inport: ‘<Root>/Input’ */
Rte_Read_RPort_InputDE(&tmpRead, &transformerError_Input);
…
/* Outport: ‘<Root>/Output’… */
(void) Rte_Write_PPort_OutputDE(data, &transformerError_Input);
…
}
I see in generated C code that it is created local variable transformerError_Input but i don’t know where in simulink model there is an equivalent of transformerError_Input.
For example:
If i need to rewrite the value from local variable transformerError_Input, how can i do it in simulnik model. e2e transformer MATLAB Answers — New Questions
Acquire Images from a Mobile Device Camera- is max resolution locked at 720p?
I am currently running 2023b update 8 with the MATLAB Support Package for Apple iOS Sensors on an iPhone 8. The maximum resolution when taking images is 720p. Is there any way to get full resolution images? Alternatively is there a way to connect the iPhone to matlab over a wire for full resolution pictures, without the cloud streaming method?I am currently running 2023b update 8 with the MATLAB Support Package for Apple iOS Sensors on an iPhone 8. The maximum resolution when taking images is 720p. Is there any way to get full resolution images? Alternatively is there a way to connect the iPhone to matlab over a wire for full resolution pictures, without the cloud streaming method? I am currently running 2023b update 8 with the MATLAB Support Package for Apple iOS Sensors on an iPhone 8. The maximum resolution when taking images is 720p. Is there any way to get full resolution images? Alternatively is there a way to connect the iPhone to matlab over a wire for full resolution pictures, without the cloud streaming method? sensors, mobile, device, camera, iphone, resolution, image acquisition, phone MATLAB Answers — New Questions
Solve and plot system in x and y with varying constants e and t
hello,
i am having troubles solving the following problem:
solve and plot for x and y
x+y+e+t>=0
And
x*y-e*t>=0
where x and y are the two variables while e and t are two constants whose values has to vary in a range: i am trying to see the effect of e and t on the system represented by x and y.
basically i would like to obtain on the same graph different curves in x and y for a fixed number of combinations of e and t.
my code so far is:
n= 21;
x = linspace(-100, 100, n);
y = linspace(-100, 100, n);
[X, Y] = meshgrid(x, y);
a = 50;
b = 5;
e = linspace(-a, a, b);
t = linspace(-a, a, b);
Z = zeros(n, n);
for k = 1:b
for s = 1:b
b = X + Y + e(k) + t(s);
d = X.*Y – e(k).*t(s);
for i= 1:n
for j= 1:n
if b(i,j) >= 0
Z(i,j) = d(i,j);
else
Z(i,j) = -1;
end
end
v = [0, 0];
contour(X, Y, Z, v, ‘LineWidth’, 1.5)
grid on
hold on
end
end
end
could anybody please give me any suggestions on how to improve it, as the result so far is not what i expect.
thank you very muchhello,
i am having troubles solving the following problem:
solve and plot for x and y
x+y+e+t>=0
And
x*y-e*t>=0
where x and y are the two variables while e and t are two constants whose values has to vary in a range: i am trying to see the effect of e and t on the system represented by x and y.
basically i would like to obtain on the same graph different curves in x and y for a fixed number of combinations of e and t.
my code so far is:
n= 21;
x = linspace(-100, 100, n);
y = linspace(-100, 100, n);
[X, Y] = meshgrid(x, y);
a = 50;
b = 5;
e = linspace(-a, a, b);
t = linspace(-a, a, b);
Z = zeros(n, n);
for k = 1:b
for s = 1:b
b = X + Y + e(k) + t(s);
d = X.*Y – e(k).*t(s);
for i= 1:n
for j= 1:n
if b(i,j) >= 0
Z(i,j) = d(i,j);
else
Z(i,j) = -1;
end
end
v = [0, 0];
contour(X, Y, Z, v, ‘LineWidth’, 1.5)
grid on
hold on
end
end
end
could anybody please give me any suggestions on how to improve it, as the result so far is not what i expect.
thank you very much hello,
i am having troubles solving the following problem:
solve and plot for x and y
x+y+e+t>=0
And
x*y-e*t>=0
where x and y are the two variables while e and t are two constants whose values has to vary in a range: i am trying to see the effect of e and t on the system represented by x and y.
basically i would like to obtain on the same graph different curves in x and y for a fixed number of combinations of e and t.
my code so far is:
n= 21;
x = linspace(-100, 100, n);
y = linspace(-100, 100, n);
[X, Y] = meshgrid(x, y);
a = 50;
b = 5;
e = linspace(-a, a, b);
t = linspace(-a, a, b);
Z = zeros(n, n);
for k = 1:b
for s = 1:b
b = X + Y + e(k) + t(s);
d = X.*Y – e(k).*t(s);
for i= 1:n
for j= 1:n
if b(i,j) >= 0
Z(i,j) = d(i,j);
else
Z(i,j) = -1;
end
end
v = [0, 0];
contour(X, Y, Z, v, ‘LineWidth’, 1.5)
grid on
hold on
end
end
end
could anybody please give me any suggestions on how to improve it, as the result so far is not what i expect.
thank you very much system of equations, plotting, iteration MATLAB Answers — New Questions
how to plot accuracy?
Error using trainNetwork (line 150)
Invalid training data. Sequence responses must have the same sequence length as the corresponding predictors.
Error in Untitled (line 92)
net = trainNetwork(x_train_seq, y_train_seq, layers, options);
% Load the files
file_path_e = ‘sig.xlsx’;
file_path_sig = ‘E.xlsx’;
% Read the files
data_e = readtable(file_path_e);
data_sig = readtable(file_path_sig);
% Prepare data
x = table2array(data_e);
y = table2array(data_sig);
% Ensure x and y have the same length
min_length = min(length(x), length(y));
x = x(1:min_length);
y = y(1:min_length);
% Display initial data types
disp(‘Initial data types:’);
disp([‘x type: ‘, class(x)]);
disp([‘y type: ‘, class(y)]);
% Convert to numeric arrays if not already
x = str2double(x);
y = str2double(y);
% Display number of NaNs before removing them
fprintf(‘Number of NaNs in x before removal: %dn’, sum(isnan(x)));
fprintf(‘Number of NaNs in y before removal: %dn’, sum(isnan(y)));
% Handle non-numeric entries by removing NaNs
valid_indices = ~isnan(x) & ~isnan(y);
x = x(valid_indices);
y = y(valid_indices);
% Display number of valid data points after removal
fprintf(‘Number of valid data points after preprocessing: %dn’, length(x));
% Ensure x and y have the same length again after removing NaNs
min_length = min(length(x), length(y));
x = x(1:min_length);
y = y(1:min_length);
% Check if there are enough valid entries
if min_length <= 1
error(‘Not enough valid data points after preprocessing.’);
end
% Reshape data to be compatible with LSTM input (samples, timesteps, features)
x = reshape(x, [], 1);
y = reshape(y, [], 1);
% Scale data using min-max normalization
x_scaled = (x – min(x)) / (max(x) – min(x));
y_scaled = (y – min(y)) / (max(y) – min(y));
% Split data into train and test sets
cv = cvpartition(length(x_scaled), ‘HoldOut’, 0.2);
x_train = x_scaled(training(cv));
y_train = y_scaled(training(cv));
x_test = x_scaled(test(cv));
y_test = y_scaled(test(cv));
% Create sequences for LSTM
seq_length = 10;
[x_train_seq, y_train_seq] = create_sequences(x_train, y_train, seq_length);
[x_test_seq, y_test_seq] = create_sequences(x_test, y_test, seq_length);
% Reshape for LSTM
x_train_seq = reshape(x_train_seq, [size(x_train_seq, 1), seq_length, 1]);
x_test_seq = reshape(x_test_seq, [size(x_test_seq, 1), seq_length, 1]);
% Build the LSTM model
layers = [
sequenceInputLayer(1)
lstmLayer(20, ‘OutputMode’, ‘sequence’)
dropoutLayer(0.2)
lstmLayer(20)
dropoutLayer(0.2)
fullyConnectedLayer(1)
regressionLayer];
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 300, …
‘MiniBatchSize’, 20, …
‘InitialLearnRate’, 0.001, …
‘ValidationData’, {x_test_seq, y_test_seq}, …
‘Plots’, ‘training-progress’, …
‘Verbose’, 0);
% Train the model
net = trainNetwork(x_train_seq, y_train_seq, layers, options);
% Plot loss curve
training_info = net.TrainingHistory;
figure;
plot(training_info.TrainingLoss, ‘DisplayName’, ‘Train’);
hold on;
plot(training_info.ValidationLoss, ‘DisplayName’, ‘Validation’);
title(‘Model loss’);
xlabel(‘Epoch’);
ylabel(‘Loss’);
legend(‘show’);
hold off;
% Function to create sequences
function [xs, ys] = create_sequences(x_data, y_data, seq_length)
xs = [];
ys = [];
for i = 1:(length(x_data) – seq_length)
x_seq = x_data(i:i+seq_length-1);
y_seq = y_data(i+seq_length-1); % Adjust index to ensure same length
xs = [xs; x_seq’];
ys = [ys; y_seq’];
end
endError using trainNetwork (line 150)
Invalid training data. Sequence responses must have the same sequence length as the corresponding predictors.
Error in Untitled (line 92)
net = trainNetwork(x_train_seq, y_train_seq, layers, options);
% Load the files
file_path_e = ‘sig.xlsx’;
file_path_sig = ‘E.xlsx’;
% Read the files
data_e = readtable(file_path_e);
data_sig = readtable(file_path_sig);
% Prepare data
x = table2array(data_e);
y = table2array(data_sig);
% Ensure x and y have the same length
min_length = min(length(x), length(y));
x = x(1:min_length);
y = y(1:min_length);
% Display initial data types
disp(‘Initial data types:’);
disp([‘x type: ‘, class(x)]);
disp([‘y type: ‘, class(y)]);
% Convert to numeric arrays if not already
x = str2double(x);
y = str2double(y);
% Display number of NaNs before removing them
fprintf(‘Number of NaNs in x before removal: %dn’, sum(isnan(x)));
fprintf(‘Number of NaNs in y before removal: %dn’, sum(isnan(y)));
% Handle non-numeric entries by removing NaNs
valid_indices = ~isnan(x) & ~isnan(y);
x = x(valid_indices);
y = y(valid_indices);
% Display number of valid data points after removal
fprintf(‘Number of valid data points after preprocessing: %dn’, length(x));
% Ensure x and y have the same length again after removing NaNs
min_length = min(length(x), length(y));
x = x(1:min_length);
y = y(1:min_length);
% Check if there are enough valid entries
if min_length <= 1
error(‘Not enough valid data points after preprocessing.’);
end
% Reshape data to be compatible with LSTM input (samples, timesteps, features)
x = reshape(x, [], 1);
y = reshape(y, [], 1);
% Scale data using min-max normalization
x_scaled = (x – min(x)) / (max(x) – min(x));
y_scaled = (y – min(y)) / (max(y) – min(y));
% Split data into train and test sets
cv = cvpartition(length(x_scaled), ‘HoldOut’, 0.2);
x_train = x_scaled(training(cv));
y_train = y_scaled(training(cv));
x_test = x_scaled(test(cv));
y_test = y_scaled(test(cv));
% Create sequences for LSTM
seq_length = 10;
[x_train_seq, y_train_seq] = create_sequences(x_train, y_train, seq_length);
[x_test_seq, y_test_seq] = create_sequences(x_test, y_test, seq_length);
% Reshape for LSTM
x_train_seq = reshape(x_train_seq, [size(x_train_seq, 1), seq_length, 1]);
x_test_seq = reshape(x_test_seq, [size(x_test_seq, 1), seq_length, 1]);
% Build the LSTM model
layers = [
sequenceInputLayer(1)
lstmLayer(20, ‘OutputMode’, ‘sequence’)
dropoutLayer(0.2)
lstmLayer(20)
dropoutLayer(0.2)
fullyConnectedLayer(1)
regressionLayer];
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 300, …
‘MiniBatchSize’, 20, …
‘InitialLearnRate’, 0.001, …
‘ValidationData’, {x_test_seq, y_test_seq}, …
‘Plots’, ‘training-progress’, …
‘Verbose’, 0);
% Train the model
net = trainNetwork(x_train_seq, y_train_seq, layers, options);
% Plot loss curve
training_info = net.TrainingHistory;
figure;
plot(training_info.TrainingLoss, ‘DisplayName’, ‘Train’);
hold on;
plot(training_info.ValidationLoss, ‘DisplayName’, ‘Validation’);
title(‘Model loss’);
xlabel(‘Epoch’);
ylabel(‘Loss’);
legend(‘show’);
hold off;
% Function to create sequences
function [xs, ys] = create_sequences(x_data, y_data, seq_length)
xs = [];
ys = [];
for i = 1:(length(x_data) – seq_length)
x_seq = x_data(i:i+seq_length-1);
y_seq = y_data(i+seq_length-1); % Adjust index to ensure same length
xs = [xs; x_seq’];
ys = [ys; y_seq’];
end
end Error using trainNetwork (line 150)
Invalid training data. Sequence responses must have the same sequence length as the corresponding predictors.
Error in Untitled (line 92)
net = trainNetwork(x_train_seq, y_train_seq, layers, options);
% Load the files
file_path_e = ‘sig.xlsx’;
file_path_sig = ‘E.xlsx’;
% Read the files
data_e = readtable(file_path_e);
data_sig = readtable(file_path_sig);
% Prepare data
x = table2array(data_e);
y = table2array(data_sig);
% Ensure x and y have the same length
min_length = min(length(x), length(y));
x = x(1:min_length);
y = y(1:min_length);
% Display initial data types
disp(‘Initial data types:’);
disp([‘x type: ‘, class(x)]);
disp([‘y type: ‘, class(y)]);
% Convert to numeric arrays if not already
x = str2double(x);
y = str2double(y);
% Display number of NaNs before removing them
fprintf(‘Number of NaNs in x before removal: %dn’, sum(isnan(x)));
fprintf(‘Number of NaNs in y before removal: %dn’, sum(isnan(y)));
% Handle non-numeric entries by removing NaNs
valid_indices = ~isnan(x) & ~isnan(y);
x = x(valid_indices);
y = y(valid_indices);
% Display number of valid data points after removal
fprintf(‘Number of valid data points after preprocessing: %dn’, length(x));
% Ensure x and y have the same length again after removing NaNs
min_length = min(length(x), length(y));
x = x(1:min_length);
y = y(1:min_length);
% Check if there are enough valid entries
if min_length <= 1
error(‘Not enough valid data points after preprocessing.’);
end
% Reshape data to be compatible with LSTM input (samples, timesteps, features)
x = reshape(x, [], 1);
y = reshape(y, [], 1);
% Scale data using min-max normalization
x_scaled = (x – min(x)) / (max(x) – min(x));
y_scaled = (y – min(y)) / (max(y) – min(y));
% Split data into train and test sets
cv = cvpartition(length(x_scaled), ‘HoldOut’, 0.2);
x_train = x_scaled(training(cv));
y_train = y_scaled(training(cv));
x_test = x_scaled(test(cv));
y_test = y_scaled(test(cv));
% Create sequences for LSTM
seq_length = 10;
[x_train_seq, y_train_seq] = create_sequences(x_train, y_train, seq_length);
[x_test_seq, y_test_seq] = create_sequences(x_test, y_test, seq_length);
% Reshape for LSTM
x_train_seq = reshape(x_train_seq, [size(x_train_seq, 1), seq_length, 1]);
x_test_seq = reshape(x_test_seq, [size(x_test_seq, 1), seq_length, 1]);
% Build the LSTM model
layers = [
sequenceInputLayer(1)
lstmLayer(20, ‘OutputMode’, ‘sequence’)
dropoutLayer(0.2)
lstmLayer(20)
dropoutLayer(0.2)
fullyConnectedLayer(1)
regressionLayer];
options = trainingOptions(‘adam’, …
‘MaxEpochs’, 300, …
‘MiniBatchSize’, 20, …
‘InitialLearnRate’, 0.001, …
‘ValidationData’, {x_test_seq, y_test_seq}, …
‘Plots’, ‘training-progress’, …
‘Verbose’, 0);
% Train the model
net = trainNetwork(x_train_seq, y_train_seq, layers, options);
% Plot loss curve
training_info = net.TrainingHistory;
figure;
plot(training_info.TrainingLoss, ‘DisplayName’, ‘Train’);
hold on;
plot(training_info.ValidationLoss, ‘DisplayName’, ‘Validation’);
title(‘Model loss’);
xlabel(‘Epoch’);
ylabel(‘Loss’);
legend(‘show’);
hold off;
% Function to create sequences
function [xs, ys] = create_sequences(x_data, y_data, seq_length)
xs = [];
ys = [];
for i = 1:(length(x_data) – seq_length)
x_seq = x_data(i:i+seq_length-1);
y_seq = y_data(i+seq_length-1); % Adjust index to ensure same length
xs = [xs; x_seq’];
ys = [ys; y_seq’];
end
end accuracy, lstm MATLAB Answers — New Questions
Use file name to save .mat files
Hello community.
I’d like to have your support to find a soluion.
I have several ‘.dat’ files, I’m usinng mdfimport to export the variables I need and then save them into ‘.mat’ format.
my code:
clear all;
clc;
[FileName,PathName] = uigetfile(‘*.dat’,’Select the .dat-file(s)’,’MultiSelect’, ‘on’);
if class(FileName) == char(‘cell’);
FileName = FileName’;
end
if class(FileName)==char(‘char’);
FileName = {FileName};
end
%========================================================================%
V = {
[‘EnvT_t’]
[‘CtT_flgHeal’]
[‘CtT_flgEna’]
[‘Epm_nEng’]
[‘CTM_Delta’]
[‘CTM_Flag’]
[‘CTM_Sum’]
};
V=V’;
for k=1:length(FileName)
%———————————————————————-
progress = [‘Working on file ‘ int2str(k) ‘ of ‘ int2str(length(FileName)) ‘…’];
disp(progress);
disp(FileName(k));
LoadPath = char(strcat(PathName, FileName(k)));
mdfimport(LoadPath,[],V, ‘resample_1’);
save([‘@’ num2str(k) ‘.mat’])
end
let’s say I have below data:
Carr1.dat
Carr2.dat
Carr3.dat
Carr4.dat
my code will go trhoug each .dat file, will extract defined variables and then it will save it as follows:
@1.mat
@2.mat
@3.mat
@4.mat
how can I use save command to keep original file name? I’m looking to get this:
Carr1.mat
Carr2.mat
Carr3.mat
Carr4.mat
I’ve tryied different things but always get an error.
as always your feedback will be highly appreciatedHello community.
I’d like to have your support to find a soluion.
I have several ‘.dat’ files, I’m usinng mdfimport to export the variables I need and then save them into ‘.mat’ format.
my code:
clear all;
clc;
[FileName,PathName] = uigetfile(‘*.dat’,’Select the .dat-file(s)’,’MultiSelect’, ‘on’);
if class(FileName) == char(‘cell’);
FileName = FileName’;
end
if class(FileName)==char(‘char’);
FileName = {FileName};
end
%========================================================================%
V = {
[‘EnvT_t’]
[‘CtT_flgHeal’]
[‘CtT_flgEna’]
[‘Epm_nEng’]
[‘CTM_Delta’]
[‘CTM_Flag’]
[‘CTM_Sum’]
};
V=V’;
for k=1:length(FileName)
%———————————————————————-
progress = [‘Working on file ‘ int2str(k) ‘ of ‘ int2str(length(FileName)) ‘…’];
disp(progress);
disp(FileName(k));
LoadPath = char(strcat(PathName, FileName(k)));
mdfimport(LoadPath,[],V, ‘resample_1’);
save([‘@’ num2str(k) ‘.mat’])
end
let’s say I have below data:
Carr1.dat
Carr2.dat
Carr3.dat
Carr4.dat
my code will go trhoug each .dat file, will extract defined variables and then it will save it as follows:
@1.mat
@2.mat
@3.mat
@4.mat
how can I use save command to keep original file name? I’m looking to get this:
Carr1.mat
Carr2.mat
Carr3.mat
Carr4.mat
I’ve tryied different things but always get an error.
as always your feedback will be highly appreciated Hello community.
I’d like to have your support to find a soluion.
I have several ‘.dat’ files, I’m usinng mdfimport to export the variables I need and then save them into ‘.mat’ format.
my code:
clear all;
clc;
[FileName,PathName] = uigetfile(‘*.dat’,’Select the .dat-file(s)’,’MultiSelect’, ‘on’);
if class(FileName) == char(‘cell’);
FileName = FileName’;
end
if class(FileName)==char(‘char’);
FileName = {FileName};
end
%========================================================================%
V = {
[‘EnvT_t’]
[‘CtT_flgHeal’]
[‘CtT_flgEna’]
[‘Epm_nEng’]
[‘CTM_Delta’]
[‘CTM_Flag’]
[‘CTM_Sum’]
};
V=V’;
for k=1:length(FileName)
%———————————————————————-
progress = [‘Working on file ‘ int2str(k) ‘ of ‘ int2str(length(FileName)) ‘…’];
disp(progress);
disp(FileName(k));
LoadPath = char(strcat(PathName, FileName(k)));
mdfimport(LoadPath,[],V, ‘resample_1’);
save([‘@’ num2str(k) ‘.mat’])
end
let’s say I have below data:
Carr1.dat
Carr2.dat
Carr3.dat
Carr4.dat
my code will go trhoug each .dat file, will extract defined variables and then it will save it as follows:
@1.mat
@2.mat
@3.mat
@4.mat
how can I use save command to keep original file name? I’m looking to get this:
Carr1.mat
Carr2.mat
Carr3.mat
Carr4.mat
I’ve tryied different things but always get an error.
as always your feedback will be highly appreciated matlab, data import, save MATLAB Answers — New Questions
daeFunction() automatically removes state variables in resulting function handle
Hi,
I implemented a 14 DOF dynamic Two-Track Model with 36 states variables in form of symbolic differential equations and i want to create a function handle from these equations so i can solve the model numerically. I already tried to use the function odeToVectorField() with no success because the model equations are non-linear. Applying the function reduceDifferentialOrder() and then daeFunction() worked but the resuting function handle is missing some state variables in its function body. Im appending the output of reduceDifferentialOrder() and daeFunction() below as .mat or .m file respectively.
Are there any other methods, to programmatically create the function handle, that im missing?
Best wishes,
TimHi,
I implemented a 14 DOF dynamic Two-Track Model with 36 states variables in form of symbolic differential equations and i want to create a function handle from these equations so i can solve the model numerically. I already tried to use the function odeToVectorField() with no success because the model equations are non-linear. Applying the function reduceDifferentialOrder() and then daeFunction() worked but the resuting function handle is missing some state variables in its function body. Im appending the output of reduceDifferentialOrder() and daeFunction() below as .mat or .m file respectively.
Are there any other methods, to programmatically create the function handle, that im missing?
Best wishes,
Tim Hi,
I implemented a 14 DOF dynamic Two-Track Model with 36 states variables in form of symbolic differential equations and i want to create a function handle from these equations so i can solve the model numerically. I already tried to use the function odeToVectorField() with no success because the model equations are non-linear. Applying the function reduceDifferentialOrder() and then daeFunction() worked but the resuting function handle is missing some state variables in its function body. Im appending the output of reduceDifferentialOrder() and daeFunction() below as .mat or .m file respectively.
Are there any other methods, to programmatically create the function handle, that im missing?
Best wishes,
Tim daefunction MATLAB Answers — New Questions
Creating simulink neural network from my own weights and bias
Hello everyone,
I have created my own neural network with matlab script (weights, bias, input, hidden and output layer) and I trained it until I got good results. but I don’t know how to assemble this script network into block simulink to use it in my simulation,
NOTE: I know the function gensim but it seems that it is used for matlab ANNs created with nntool, not for the manually created network.Hello everyone,
I have created my own neural network with matlab script (weights, bias, input, hidden and output layer) and I trained it until I got good results. but I don’t know how to assemble this script network into block simulink to use it in my simulation,
NOTE: I know the function gensim but it seems that it is used for matlab ANNs created with nntool, not for the manually created network. Hello everyone,
I have created my own neural network with matlab script (weights, bias, input, hidden and output layer) and I trained it until I got good results. but I don’t know how to assemble this script network into block simulink to use it in my simulation,
NOTE: I know the function gensim but it seems that it is used for matlab ANNs created with nntool, not for the manually created network. gensim / neural netwok / simulink MATLAB Answers — New Questions
How do I fit multiple curves at once, sharing some fitting parameters and floating others?
Hi,
I am new to using MATLAB and SIMBIOLOGY. I am trying to fit 6 binding curves where the ligand is the same throughout the experiment and only the analyte concentrations are different. I want to globally fit all 6 curves to one model, sharing the rate parameters but not sharing the concentration parameters. Is there a way to do this in simbiology? When I am setting up the Data Map I have my independent variable as Time, since binding is measured over time, and I have 6 responses each corresponding to my binding response generated for each analyte concentration. I get an error of "The same model component appears in the left-hand side of multiple elements of the responseMap input argument. The responseMap cannot contain any duplicates." Any help would be great! Attached is the data I am trying to fit.Hi,
I am new to using MATLAB and SIMBIOLOGY. I am trying to fit 6 binding curves where the ligand is the same throughout the experiment and only the analyte concentrations are different. I want to globally fit all 6 curves to one model, sharing the rate parameters but not sharing the concentration parameters. Is there a way to do this in simbiology? When I am setting up the Data Map I have my independent variable as Time, since binding is measured over time, and I have 6 responses each corresponding to my binding response generated for each analyte concentration. I get an error of "The same model component appears in the left-hand side of multiple elements of the responseMap input argument. The responseMap cannot contain any duplicates." Any help would be great! Attached is the data I am trying to fit. Hi,
I am new to using MATLAB and SIMBIOLOGY. I am trying to fit 6 binding curves where the ligand is the same throughout the experiment and only the analyte concentrations are different. I want to globally fit all 6 curves to one model, sharing the rate parameters but not sharing the concentration parameters. Is there a way to do this in simbiology? When I am setting up the Data Map I have my independent variable as Time, since binding is measured over time, and I have 6 responses each corresponding to my binding response generated for each analyte concentration. I get an error of "The same model component appears in the left-hand side of multiple elements of the responseMap input argument. The responseMap cannot contain any duplicates." Any help would be great! Attached is the data I am trying to fit. curve fitting, simbiology, binding, multiple curves MATLAB Answers — New Questions
New initial starting point (input and output) of already trained LSTM Network
I have input data X and output data Y.
I am training a LSTM network using:
net = trainNetwork(X(1:500), Y(1:500), layers, options);
This trains and initialize the network
However is there a way to initialize the network with for example X(1:600) and Y(1:600), not by retraining but by using the previous trained network ansd start any new predictions from that point on (601 and up)?I have input data X and output data Y.
I am training a LSTM network using:
net = trainNetwork(X(1:500), Y(1:500), layers, options);
This trains and initialize the network
However is there a way to initialize the network with for example X(1:600) and Y(1:600), not by retraining but by using the previous trained network ansd start any new predictions from that point on (601 and up)? I have input data X and output data Y.
I am training a LSTM network using:
net = trainNetwork(X(1:500), Y(1:500), layers, options);
This trains and initialize the network
However is there a way to initialize the network with for example X(1:600) and Y(1:600), not by retraining but by using the previous trained network ansd start any new predictions from that point on (601 and up)? lstm initiate deep learning MATLAB Answers — New Questions
Hello, how do you simulate real-time load profile on Simulink using lookup tables? My daily load profile is hourly KW and i want to simulate the load in a solar PV system?
My load profile is hourly KW data over a period of 24 hrsMy load profile is hourly KW data over a period of 24 hrs My load profile is hourly KW data over a period of 24 hrs lookup tables, load, variable load MATLAB Answers — New Questions