Category: Matlab
Category Archives: Matlab
Can pdepe solve a system of two second-order equations?
I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
.
My idea is to rewrite it by including a second variable
where
.
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 0];
f = [D*dudx(2); dudx(1)];
s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
init = 1-cos(x);
d2init_dx2 = cos(x);
u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = [0;0];
ql = [1;1];
pr = [0;0];
qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don’t get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don’t really understand it without the written equations.
Thank you very much for answering.I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
.
My idea is to rewrite it by including a second variable
where
.
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 0];
f = [D*dudx(2); dudx(1)];
s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
init = 1-cos(x);
d2init_dx2 = cos(x);
u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = [0;0];
ql = [1;1];
pr = [0;0];
qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don’t get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don’t really understand it without the written equations.
Thank you very much for answering. I am trying to figure out pdepe and how to use it to solve a higher order equation written as multiple second order equations. Even though I am trying to solve a more complex equation in the future I want to start with a simple case
.
My idea is to rewrite it by including a second variable
where
.
I chose the spatial coordinate to range from x=linsapce(0,2*pi,N) to ensure that my initial conditions satisfy my boundary conditions (see below).
In pdepe terms I wrote
function [c,f,s] = pdex1pde(x,t,u,dudx)
global D
c = [1 ; 0];
f = [D*dudx(2); dudx(1)];
s = [0; -u(2)]; %where q=u(2);
end
and providing some initial condition (from 0 to 2pi)
function u0 = pdex1ic(x)
init = 1-cos(x);
d2init_dx2 = cos(x);
u0 = [init; d2init_dx2]
end
For the boundary conditions I just used a Neumann boundary for each boundary
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t)
pl = [0;0];
ql = [1;1];
pr = [0;0];
qr = [1;1];
end
Now pdepe gives me a warning that it could not converge at time t=0 and I don’t get a result.
Is there something that I am missing?
I had a look at other questions about this topic and already stumbled upon this github page (https://github.com/wgreene310/pdepe-examples), but I don’t really understand it without the written equations.
Thank you very much for answering. pdepe, pde, system of equations MATLAB Answers — New Questions
getrect and ginput are not supported by codegen
Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use?Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use? Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use? codegen, dll MATLAB Answers — New Questions
PAPR (Peak to Average Power Ratio) of OFDM(Orthogonal Frequency Division Multiplexing)
will the PAPR(Peak to Average Power Ratio) of OFDM (Orthogonal Frequency Division Multiplexing) be effected if we use different modulation schemes?
1) effect on PAPR using M-QAM
2) effect on PAPR using M-PSKwill the PAPR(Peak to Average Power Ratio) of OFDM (Orthogonal Frequency Division Multiplexing) be effected if we use different modulation schemes?
1) effect on PAPR using M-QAM
2) effect on PAPR using M-PSK will the PAPR(Peak to Average Power Ratio) of OFDM (Orthogonal Frequency Division Multiplexing) be effected if we use different modulation schemes?
1) effect on PAPR using M-QAM
2) effect on PAPR using M-PSK papr of ofdm, papr (peak to average power ratio) of ofdm(orthogonal frequency division multiplexing) MATLAB Answers — New Questions
Simulink : How to inject real and image current into three phase power grid by using discrete mode powergui
Hello,everyone.
I have trouble when I setting real and image current respectly and inject them to infinite bus.
I need to use powergui in discrete phasor mode to simulate the system,but I want to use powergui in discrete mode.
Is this possible to inject real and image current into three phase power system by powergui in discrete mode?
Thank you for your reply!!Hello,everyone.
I have trouble when I setting real and image current respectly and inject them to infinite bus.
I need to use powergui in discrete phasor mode to simulate the system,but I want to use powergui in discrete mode.
Is this possible to inject real and image current into three phase power system by powergui in discrete mode?
Thank you for your reply!! Hello,everyone.
I have trouble when I setting real and image current respectly and inject them to infinite bus.
I need to use powergui in discrete phasor mode to simulate the system,but I want to use powergui in discrete mode.
Is this possible to inject real and image current into three phase power system by powergui in discrete mode?
Thank you for your reply!! simscape, simulink MATLAB Answers — New Questions
Problem with mvregress when working with cell arrays
Hi,
I have a problem when using multivariate regression function (mvregress) available in matlab.
I have a cell array with 20 cells in each of which there are three values as inputs and my target output is a vector with 20 values. When I load this data and call mvregress function, it gives the error: "Undefined function ‘isnan’ for input arguments of type ‘cell’."
To eliminate this problem I tried using: data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But this makes all my values zero.
My code is given below:
load mywork1.mat
[beta,Sigma, resid] = mvregress(targetvalues’,originaldata)
Since it gives the error ("Undefined function ‘isnan’ for input arguments of type ‘cell’."), I tried the following
data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But then all my data cells are replaced with zeros.
How can I resolve this issue and perform multivariate regression on these data?
I have attached the data set.
Thank you in advance.Hi,
I have a problem when using multivariate regression function (mvregress) available in matlab.
I have a cell array with 20 cells in each of which there are three values as inputs and my target output is a vector with 20 values. When I load this data and call mvregress function, it gives the error: "Undefined function ‘isnan’ for input arguments of type ‘cell’."
To eliminate this problem I tried using: data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But this makes all my values zero.
My code is given below:
load mywork1.mat
[beta,Sigma, resid] = mvregress(targetvalues’,originaldata)
Since it gives the error ("Undefined function ‘isnan’ for input arguments of type ‘cell’."), I tried the following
data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But then all my data cells are replaced with zeros.
How can I resolve this issue and perform multivariate regression on these data?
I have attached the data set.
Thank you in advance. Hi,
I have a problem when using multivariate regression function (mvregress) available in matlab.
I have a cell array with 20 cells in each of which there are three values as inputs and my target output is a vector with 20 values. When I load this data and call mvregress function, it gives the error: "Undefined function ‘isnan’ for input arguments of type ‘cell’."
To eliminate this problem I tried using: data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But this makes all my values zero.
My code is given below:
load mywork1.mat
[beta,Sigma, resid] = mvregress(targetvalues’,originaldata)
Since it gives the error ("Undefined function ‘isnan’ for input arguments of type ‘cell’."), I tried the following
data = cellfun(@isnan,originaldata,’UniformOutput’,false)
But then all my data cells are replaced with zeros.
How can I resolve this issue and perform multivariate regression on these data?
I have attached the data set.
Thank you in advance. regression, mvregress, isnan MATLAB Answers — New Questions
error in downloading trial version
following statement appears again and again after retry
The following error was detected while downloading foundation/httpproxy_win64_1550744841.enc:
Wrong number of bytes: Expected 74382, got 5291following statement appears again and again after retry
The following error was detected while downloading foundation/httpproxy_win64_1550744841.enc:
Wrong number of bytes: Expected 74382, got 5291 following statement appears again and again after retry
The following error was detected while downloading foundation/httpproxy_win64_1550744841.enc:
Wrong number of bytes: Expected 74382, got 5291 trial version, student version, wrong number of bytes MATLAB Answers — New Questions
Can’t get ‘ValueChangedFcn’ callback to work for ‘uidatepicker ‘
Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas?Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas? Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas? valuechangedfcn, uidatepicker MATLAB Answers — New Questions
How to click into the heatmap created inside a UI panel?
I’m working on building an interactive Heatmap in Matlab UI. added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. Once I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks!I’m working on building an interactive Heatmap in Matlab UI. added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. Once I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks! I’m working on building an interactive Heatmap in Matlab UI. added a UI Panel to the interface and populated the heatmap within the panel. Now that I know how to get the row and column upon clicking the Heatmap cell, the issue now is I’m not able to actually click into the heatmap within the UI Panel. I tried using the “WindowButtonDownFcn”, but was only able to click into any blank area within the UI Panel. Once I click on the heatmap in the UI panel, there is no response at all.
May I know how I could click into the heatmap created inside the UI Panel? Thanks! heatmap, appdesigner, matlab gui MATLAB Answers — New Questions
how to recombine blocks of an image into one?
Dear sir,
I am working on Watermarking. I divided a color host image into blocks using mat2cell. i hid watermark images in respective blocks. i wanted to know how i can recombine the watermarked blocks?Dear sir,
I am working on Watermarking. I divided a color host image into blocks using mat2cell. i hid watermark images in respective blocks. i wanted to know how i can recombine the watermarked blocks? Dear sir,
I am working on Watermarking. I divided a color host image into blocks using mat2cell. i hid watermark images in respective blocks. i wanted to know how i can recombine the watermarked blocks? watermarking, mat2cell MATLAB Answers — New Questions
App Designer, tab-group : docking/ undocking/ closing possibilities
if there is a possibility to implement dock/undock/ close features for tabs when designing an app using app designer . These options are mainly for the user :
> right click on the top of the required tab and performed the desire options ( close / dock/ undock ) – otherwise the app gets overcrowded with too many tabs opened .if there is a possibility to implement dock/undock/ close features for tabs when designing an app using app designer . These options are mainly for the user :
> right click on the top of the required tab and performed the desire options ( close / dock/ undock ) – otherwise the app gets overcrowded with too many tabs opened . if there is a possibility to implement dock/undock/ close features for tabs when designing an app using app designer . These options are mainly for the user :
> right click on the top of the required tab and performed the desire options ( close / dock/ undock ) – otherwise the app gets overcrowded with too many tabs opened . app designer, uitab, uitabgroup, docking/undocking MATLAB Answers — New Questions
The Problem with clc; clear; close all; ?
A few days ago someone pointed out that using:
clc; clear; close all;
Is considered as a case of code smell and cargo cult programming.
But does that really have to be the case?
clc: cleans up the command window and now one can work without getting confused with the commands for previous runs
clear: erases the variables from previous runs this will reduce chances of error in subsequent runs and the programmer does not have to worry about unnecessary trash variables.
close all: closes all currently open figures. This can be very helpful during subsequent runs of the same script. If the figure from the previous run has not been closed then the subsequent run will plot the data on the already open figure. Which of course is a total waste.
What is the problem with using these commands?A few days ago someone pointed out that using:
clc; clear; close all;
Is considered as a case of code smell and cargo cult programming.
But does that really have to be the case?
clc: cleans up the command window and now one can work without getting confused with the commands for previous runs
clear: erases the variables from previous runs this will reduce chances of error in subsequent runs and the programmer does not have to worry about unnecessary trash variables.
close all: closes all currently open figures. This can be very helpful during subsequent runs of the same script. If the figure from the previous run has not been closed then the subsequent run will plot the data on the already open figure. Which of course is a total waste.
What is the problem with using these commands? A few days ago someone pointed out that using:
clc; clear; close all;
Is considered as a case of code smell and cargo cult programming.
But does that really have to be the case?
clc: cleans up the command window and now one can work without getting confused with the commands for previous runs
clear: erases the variables from previous runs this will reduce chances of error in subsequent runs and the programmer does not have to worry about unnecessary trash variables.
close all: closes all currently open figures. This can be very helpful during subsequent runs of the same script. If the figure from the previous run has not been closed then the subsequent run will plot the data on the already open figure. Which of course is a total waste.
What is the problem with using these commands? codesmell, cargocultprogramming, clc, clear, close all MATLAB Answers — New Questions
Finding series of values within array
Hi, I am up for a problem which I cannot totally solve.
Imagine I have an array: testtimes=[0.2 1.2 1.202 1.205 1.209 1.8 2.1 2.6 2.604 2.606 3.601 3.603 3.605];
Now I need to find all series of values where the difference between values is less than 0.01. So for now I did this:
if true
% code
end
% reference = 0.01
% isitesttimes=diff(testtimes); belowBIthreshold=(isitesttimes<reference);
% belowBIthreshold = [false, belowBIthreshold, false];
% edges = diff(belowBIthreshold);
% rising = find(edges==1); falling = find(edges==-1); spanWidth = falling – rising; wideEnough = spanWidth >= 3;
% startPos = rising(wideEnough);
% endPos = falling(wideEnough)-1;
% allInSpan = cell2mat(arrayfun(@(x,y) x:1:y, startPos, endPos, ‘uni’, false))
However, the answer now is
allInSpan = 2 3 4
Which means that on position 2,3,4 in testtimes the values are postioned which have a difference less than 0.01. However, the correct answer in this example would be 2,3,4,5 (since also position 5 has a difference of less than 0.01 compared to the one on position 4) (apart from that 8,9,10,11,12,13 should also be in the answer but that has to do (I guess) with the cut-off/Span-Width of 3).
Preferably I would get a variable which has per row the positions of the testtimes, so:
Answer = 2,3,4
8,9,10
11,12,13 (because between 10 and 11 there is more than 0.01 difference)
Can somebody help me out?
Regards
PS I know that there are more topics about this but I couldn’t find the one which specifically adressess this question.Hi, I am up for a problem which I cannot totally solve.
Imagine I have an array: testtimes=[0.2 1.2 1.202 1.205 1.209 1.8 2.1 2.6 2.604 2.606 3.601 3.603 3.605];
Now I need to find all series of values where the difference between values is less than 0.01. So for now I did this:
if true
% code
end
% reference = 0.01
% isitesttimes=diff(testtimes); belowBIthreshold=(isitesttimes<reference);
% belowBIthreshold = [false, belowBIthreshold, false];
% edges = diff(belowBIthreshold);
% rising = find(edges==1); falling = find(edges==-1); spanWidth = falling – rising; wideEnough = spanWidth >= 3;
% startPos = rising(wideEnough);
% endPos = falling(wideEnough)-1;
% allInSpan = cell2mat(arrayfun(@(x,y) x:1:y, startPos, endPos, ‘uni’, false))
However, the answer now is
allInSpan = 2 3 4
Which means that on position 2,3,4 in testtimes the values are postioned which have a difference less than 0.01. However, the correct answer in this example would be 2,3,4,5 (since also position 5 has a difference of less than 0.01 compared to the one on position 4) (apart from that 8,9,10,11,12,13 should also be in the answer but that has to do (I guess) with the cut-off/Span-Width of 3).
Preferably I would get a variable which has per row the positions of the testtimes, so:
Answer = 2,3,4
8,9,10
11,12,13 (because between 10 and 11 there is more than 0.01 difference)
Can somebody help me out?
Regards
PS I know that there are more topics about this but I couldn’t find the one which specifically adressess this question. Hi, I am up for a problem which I cannot totally solve.
Imagine I have an array: testtimes=[0.2 1.2 1.202 1.205 1.209 1.8 2.1 2.6 2.604 2.606 3.601 3.603 3.605];
Now I need to find all series of values where the difference between values is less than 0.01. So for now I did this:
if true
% code
end
% reference = 0.01
% isitesttimes=diff(testtimes); belowBIthreshold=(isitesttimes<reference);
% belowBIthreshold = [false, belowBIthreshold, false];
% edges = diff(belowBIthreshold);
% rising = find(edges==1); falling = find(edges==-1); spanWidth = falling – rising; wideEnough = spanWidth >= 3;
% startPos = rising(wideEnough);
% endPos = falling(wideEnough)-1;
% allInSpan = cell2mat(arrayfun(@(x,y) x:1:y, startPos, endPos, ‘uni’, false))
However, the answer now is
allInSpan = 2 3 4
Which means that on position 2,3,4 in testtimes the values are postioned which have a difference less than 0.01. However, the correct answer in this example would be 2,3,4,5 (since also position 5 has a difference of less than 0.01 compared to the one on position 4) (apart from that 8,9,10,11,12,13 should also be in the answer but that has to do (I guess) with the cut-off/Span-Width of 3).
Preferably I would get a variable which has per row the positions of the testtimes, so:
Answer = 2,3,4
8,9,10
11,12,13 (because between 10 and 11 there is more than 0.01 difference)
Can somebody help me out?
Regards
PS I know that there are more topics about this but I couldn’t find the one which specifically adressess this question. find MATLAB Answers — New Questions
Use Preelokup and n-Direct Lookup Table blocks in Simulink without interpolation
Hi,
I want to create a lookup table that based on some inputs, where the indeces of the lookup table are found and the field value is output.
I attach the lookup table I made with its corresponding breakpoints.
I am using two Preelokup blocks to find the indeces of this 2D table. These indices are used then as input to the Direct LookupTable block (see the attached block diagram picture).
My issue is that if I input e.g., 28 in "in1", the index found is correct. However, if I put a value within two breakpoint values (e.g., 30) it uses interpolation, flat or rounding, and I would like to avoid that. Is there a way where if the input value does not match with any of the breakpoints array it simply does not return any index or the Lookup table simply returns no value or a zero?
Thanks in advanceHi,
I want to create a lookup table that based on some inputs, where the indeces of the lookup table are found and the field value is output.
I attach the lookup table I made with its corresponding breakpoints.
I am using two Preelokup blocks to find the indeces of this 2D table. These indices are used then as input to the Direct LookupTable block (see the attached block diagram picture).
My issue is that if I input e.g., 28 in "in1", the index found is correct. However, if I put a value within two breakpoint values (e.g., 30) it uses interpolation, flat or rounding, and I would like to avoid that. Is there a way where if the input value does not match with any of the breakpoints array it simply does not return any index or the Lookup table simply returns no value or a zero?
Thanks in advance Hi,
I want to create a lookup table that based on some inputs, where the indeces of the lookup table are found and the field value is output.
I attach the lookup table I made with its corresponding breakpoints.
I am using two Preelokup blocks to find the indeces of this 2D table. These indices are used then as input to the Direct LookupTable block (see the attached block diagram picture).
My issue is that if I input e.g., 28 in "in1", the index found is correct. However, if I put a value within two breakpoint values (e.g., 30) it uses interpolation, flat or rounding, and I would like to avoid that. Is there a way where if the input value does not match with any of the breakpoints array it simply does not return any index or the Lookup table simply returns no value or a zero?
Thanks in advance simulink, lookuptable MATLAB Answers — New Questions
serial data matlab and arduino
i send data from matlab command via serial to arduino uno in
this command :
arduino=serialport("COM9",115200); writeline(arduino,"45,90,135,180,225,273,231");
i want to send this data from serial arduino mega serial1 to serial0 of arduino uno via simulink i tryed this but it not worki send data from matlab command via serial to arduino uno in
this command :
arduino=serialport("COM9",115200); writeline(arduino,"45,90,135,180,225,273,231");
i want to send this data from serial arduino mega serial1 to serial0 of arduino uno via simulink i tryed this but it not work i send data from matlab command via serial to arduino uno in
this command :
arduino=serialport("COM9",115200); writeline(arduino,"45,90,135,180,225,273,231");
i want to send this data from serial arduino mega serial1 to serial0 of arduino uno via simulink i tryed this but it not work matlab, simulink, serial, arduino, mega, uno, communication, compiler, c++ MATLAB Answers — New Questions
When I click on Performance Adviser in Simulink I get DMR client’s dictionary function threw std::exception ‘Failed to create cache
I’ve changed the equations I’d like to use for the resistor, dc voltage source and dc current source to a quadratic formula by going to the "source code" when clicking on the element properties, as this electrical circuit will actually be an analogy for a mechanical circuit.
However, it is not performing as I expect, with a negative current in one branch of the circuit.
So to understand what could be the issue, I clicked on performance adviser and get the failed to get cache error shown in the title of the question.
When I click on Model Adviser I also get:
Error occurred during model compile.
Error during code generation: Dot indexing is not supported for variables of this type.
The circuit is too big to take a screenshot of when zooming out without some parts becoming invisible.
I changed the equations to be V = I^2*R and P = I^3*R.I’ve changed the equations I’d like to use for the resistor, dc voltage source and dc current source to a quadratic formula by going to the "source code" when clicking on the element properties, as this electrical circuit will actually be an analogy for a mechanical circuit.
However, it is not performing as I expect, with a negative current in one branch of the circuit.
So to understand what could be the issue, I clicked on performance adviser and get the failed to get cache error shown in the title of the question.
When I click on Model Adviser I also get:
Error occurred during model compile.
Error during code generation: Dot indexing is not supported for variables of this type.
The circuit is too big to take a screenshot of when zooming out without some parts becoming invisible.
I changed the equations to be V = I^2*R and P = I^3*R. I’ve changed the equations I’d like to use for the resistor, dc voltage source and dc current source to a quadratic formula by going to the "source code" when clicking on the element properties, as this electrical circuit will actually be an analogy for a mechanical circuit.
However, it is not performing as I expect, with a negative current in one branch of the circuit.
So to understand what could be the issue, I clicked on performance adviser and get the failed to get cache error shown in the title of the question.
When I click on Model Adviser I also get:
Error occurred during model compile.
Error during code generation: Dot indexing is not supported for variables of this type.
The circuit is too big to take a screenshot of when zooming out without some parts becoming invisible.
I changed the equations to be V = I^2*R and P = I^3*R. error, dmr, dot indexing, simulink, code generation MATLAB Answers — New Questions
Problems associated with derivative blocks in simulink
I encountered a problem with simulink derivative block when I was doing a simulation where third order derivatives of the input is required! However, I could not use three consecutive derivative blocks in simulink since I would get a huge number at t=0 resulted from numerical differentiation. This can be shown as follows
<</matlabcentral/answers/uploaded_files/40691/1.PNG>>
Instead of getting a smooth -cos(x) single I get
<</matlabcentral/answers/uploaded_files/40692/2.PNG>>
Is there a way to get rid of this problem?I encountered a problem with simulink derivative block when I was doing a simulation where third order derivatives of the input is required! However, I could not use three consecutive derivative blocks in simulink since I would get a huge number at t=0 resulted from numerical differentiation. This can be shown as follows
<</matlabcentral/answers/uploaded_files/40691/1.PNG>>
Instead of getting a smooth -cos(x) single I get
<</matlabcentral/answers/uploaded_files/40692/2.PNG>>
Is there a way to get rid of this problem? I encountered a problem with simulink derivative block when I was doing a simulation where third order derivatives of the input is required! However, I could not use three consecutive derivative blocks in simulink since I would get a huge number at t=0 resulted from numerical differentiation. This can be shown as follows
<</matlabcentral/answers/uploaded_files/40691/1.PNG>>
Instead of getting a smooth -cos(x) single I get
<</matlabcentral/answers/uploaded_files/40692/2.PNG>>
Is there a way to get rid of this problem? simulink, derivative blocks MATLAB Answers — New Questions
issue in configuration of embedded coder c2000
Hello,
I have downloaded the embedded coder pack for TI c2000 processor, but while configuring it is asking the toolchain of CCS.
I have CCS of version 10.4.0, but in the drop down option list option showing with version upto 6, and then when I select the CCS v6 and try to validate it, it is showing error message like readme text file not found.
is it required to download lower version of CCS to complete this setup?Hello,
I have downloaded the embedded coder pack for TI c2000 processor, but while configuring it is asking the toolchain of CCS.
I have CCS of version 10.4.0, but in the drop down option list option showing with version upto 6, and then when I select the CCS v6 and try to validate it, it is showing error message like readme text file not found.
is it required to download lower version of CCS to complete this setup? Hello,
I have downloaded the embedded coder pack for TI c2000 processor, but while configuring it is asking the toolchain of CCS.
I have CCS of version 10.4.0, but in the drop down option list option showing with version upto 6, and then when I select the CCS v6 and try to validate it, it is showing error message like readme text file not found.
is it required to download lower version of CCS to complete this setup? c2000, ccs, embedded coder, code composer studio, code generation MATLAB Answers — New Questions
Finding parameters by fitting data to a system of ODEs with lsqnonlin
Dear Matlab Team,
I have a system of ODEs, with three parameters (s,d,gamma). I want to find the parameters by fitting data to this system:
First eq1: dT0/dt = s – d*T0 – gamma * T0
Second eq2: dT1/dt = 2*d*T0 + d*T1 – gamma * T1
I know that T0 converge to 2016 and T1 converge to 42 in steady state. Now, I want to find estimation for (s,d,gamma) by lsqnonlin.
Thanks for your help and time !!Dear Matlab Team,
I have a system of ODEs, with three parameters (s,d,gamma). I want to find the parameters by fitting data to this system:
First eq1: dT0/dt = s – d*T0 – gamma * T0
Second eq2: dT1/dt = 2*d*T0 + d*T1 – gamma * T1
I know that T0 converge to 2016 and T1 converge to 42 in steady state. Now, I want to find estimation for (s,d,gamma) by lsqnonlin.
Thanks for your help and time !! Dear Matlab Team,
I have a system of ODEs, with three parameters (s,d,gamma). I want to find the parameters by fitting data to this system:
First eq1: dT0/dt = s – d*T0 – gamma * T0
Second eq2: dT1/dt = 2*d*T0 + d*T1 – gamma * T1
I know that T0 converge to 2016 and T1 converge to 42 in steady state. Now, I want to find estimation for (s,d,gamma) by lsqnonlin.
Thanks for your help and time !! system of odes, fitting MATLAB Answers — New Questions
I need to get reads from mpu6050 sensor through MATLAB GUI using Arduino
already tested a lot of codes and found nothingalready tested a lot of codes and found nothing already tested a lot of codes and found nothing gui MATLAB Answers — New Questions
Problem Related to plot
I am plotting a graph, say X vs Y. What command is to be used in order to extract values of Y with respect to Different values of X.? Say, X ranges from 0 to 20 and Y ranges from 0 to 10. The plot is of non-linear nature. I want values of Y for different X such as 10,15 and 23. So what command is to be used to find values of Y?I am plotting a graph, say X vs Y. What command is to be used in order to extract values of Y with respect to Different values of X.? Say, X ranges from 0 to 20 and Y ranges from 0 to 10. The plot is of non-linear nature. I want values of Y for different X such as 10,15 and 23. So what command is to be used to find values of Y? I am plotting a graph, say X vs Y. What command is to be used in order to extract values of Y with respect to Different values of X.? Say, X ranges from 0 to 20 and Y ranges from 0 to 10. The plot is of non-linear nature. I want values of Y for different X such as 10,15 and 23. So what command is to be used to find values of Y? plot MATLAB Answers — New Questions