Month: June 2024
Need urgent help in multivariate analysis
Hi, i need urgent help to validate this data. I’m trying to used meshgrid to plot but the figure is somehow kind of weird. please help..thanks.;
x1=[28.1000000000000;28.3100000000000;28.7700000000000;29.9200000000000;29.9800000000000;29.7300000000000;29.4500000000000;29.4500000000000;29.3000000000000;30.1900000000000;29.0300000000000;28.8300000000000];
x2=[15.9800000000000;2.93000000000000;0.930000000000000;1.46000000000000;3.89000000000000;2.57000000000000;5.66000000000000;9.92000000000000;8.57000000000000;4.45000000000000;37.9700000000000;34.3300000000000];
y=[28.2000000000000;29.0800000000000;30.5300000000000;32.2100000000000;32.3000000000000;32.1300000000000;31.4200000000000;31.4400000000000;31.0100000000000;31.4200000000000;29.3700000000000;28.6800000000000];
X = [ones(size(x1)) x1 x2 x1.*x2];
b = regress(y,X) % Removes NaN data
b =
-9.5805
1.3901
-1.3429
0.0449
>> [~,~,~,~,stats] = regress(y,X)
stats =
0.9269 33.8380 0.0001 0.2126
>> sin(X)
ans =
0.8415 0.1735 -0.2687 0.2082
0.8415 -0.0357 0.2100 0.9542
0.8415 -0.4756 0.8016 0.9986
0.8415 -0.9972 0.9939 -0.2947
0.8415 -0.9909 -0.6805 -0.3740
0.8415 -0.9934 0.5410 0.8457
0.8415 -0.9229 -0.5836 -0.1816
0.8415 -0.9229 -0.4752 0.0241
0.8415 -0.8551 0.7544 -0.2245
0.8415 -0.9411 -0.9658 0.6765
0.8415 -0.6858 0.2676 0.4168
0.8415 -0.5275 0.2256 -0.1318
>> y = sin(X);
X = linspace(0,0.5*pi);
>> y = X’;
z = X .* exp(-X.^2 – y.^2);
surf(X,y,z)
>> xlabel(‘air temperature’)
ylabel(‘total rainfall’)
ylabel(‘total rainfall’)
zlabel(‘water temperature’)
view(50,10)Hi, i need urgent help to validate this data. I’m trying to used meshgrid to plot but the figure is somehow kind of weird. please help..thanks.;
x1=[28.1000000000000;28.3100000000000;28.7700000000000;29.9200000000000;29.9800000000000;29.7300000000000;29.4500000000000;29.4500000000000;29.3000000000000;30.1900000000000;29.0300000000000;28.8300000000000];
x2=[15.9800000000000;2.93000000000000;0.930000000000000;1.46000000000000;3.89000000000000;2.57000000000000;5.66000000000000;9.92000000000000;8.57000000000000;4.45000000000000;37.9700000000000;34.3300000000000];
y=[28.2000000000000;29.0800000000000;30.5300000000000;32.2100000000000;32.3000000000000;32.1300000000000;31.4200000000000;31.4400000000000;31.0100000000000;31.4200000000000;29.3700000000000;28.6800000000000];
X = [ones(size(x1)) x1 x2 x1.*x2];
b = regress(y,X) % Removes NaN data
b =
-9.5805
1.3901
-1.3429
0.0449
>> [~,~,~,~,stats] = regress(y,X)
stats =
0.9269 33.8380 0.0001 0.2126
>> sin(X)
ans =
0.8415 0.1735 -0.2687 0.2082
0.8415 -0.0357 0.2100 0.9542
0.8415 -0.4756 0.8016 0.9986
0.8415 -0.9972 0.9939 -0.2947
0.8415 -0.9909 -0.6805 -0.3740
0.8415 -0.9934 0.5410 0.8457
0.8415 -0.9229 -0.5836 -0.1816
0.8415 -0.9229 -0.4752 0.0241
0.8415 -0.8551 0.7544 -0.2245
0.8415 -0.9411 -0.9658 0.6765
0.8415 -0.6858 0.2676 0.4168
0.8415 -0.5275 0.2256 -0.1318
>> y = sin(X);
X = linspace(0,0.5*pi);
>> y = X’;
z = X .* exp(-X.^2 – y.^2);
surf(X,y,z)
>> xlabel(‘air temperature’)
ylabel(‘total rainfall’)
ylabel(‘total rainfall’)
zlabel(‘water temperature’)
view(50,10) Hi, i need urgent help to validate this data. I’m trying to used meshgrid to plot but the figure is somehow kind of weird. please help..thanks.;
x1=[28.1000000000000;28.3100000000000;28.7700000000000;29.9200000000000;29.9800000000000;29.7300000000000;29.4500000000000;29.4500000000000;29.3000000000000;30.1900000000000;29.0300000000000;28.8300000000000];
x2=[15.9800000000000;2.93000000000000;0.930000000000000;1.46000000000000;3.89000000000000;2.57000000000000;5.66000000000000;9.92000000000000;8.57000000000000;4.45000000000000;37.9700000000000;34.3300000000000];
y=[28.2000000000000;29.0800000000000;30.5300000000000;32.2100000000000;32.3000000000000;32.1300000000000;31.4200000000000;31.4400000000000;31.0100000000000;31.4200000000000;29.3700000000000;28.6800000000000];
X = [ones(size(x1)) x1 x2 x1.*x2];
b = regress(y,X) % Removes NaN data
b =
-9.5805
1.3901
-1.3429
0.0449
>> [~,~,~,~,stats] = regress(y,X)
stats =
0.9269 33.8380 0.0001 0.2126
>> sin(X)
ans =
0.8415 0.1735 -0.2687 0.2082
0.8415 -0.0357 0.2100 0.9542
0.8415 -0.4756 0.8016 0.9986
0.8415 -0.9972 0.9939 -0.2947
0.8415 -0.9909 -0.6805 -0.3740
0.8415 -0.9934 0.5410 0.8457
0.8415 -0.9229 -0.5836 -0.1816
0.8415 -0.9229 -0.4752 0.0241
0.8415 -0.8551 0.7544 -0.2245
0.8415 -0.9411 -0.9658 0.6765
0.8415 -0.6858 0.2676 0.4168
0.8415 -0.5275 0.2256 -0.1318
>> y = sin(X);
X = linspace(0,0.5*pi);
>> y = X’;
z = X .* exp(-X.^2 – y.^2);
surf(X,y,z)
>> xlabel(‘air temperature’)
ylabel(‘total rainfall’)
ylabel(‘total rainfall’)
zlabel(‘water temperature’)
view(50,10) meshgrid, matlab, matlab code MATLAB Answers — New Questions
How to animate a mechanism?
in this attached code i want to vary theta1 and theta2 from 0 to 360 deg at same rate and want to plot updated positions of ain,bin,cin while o2,o4 are fixed on axes input_axis and output_axes respectively.
it is a 3d mechanism,ain is rotating about input_axis and bin is rotating about output_axis and cin is also updating which joins to updated positions of ain and bin.
Please someone tell ,how to animate this mechanism properly!!
Thanksin this attached code i want to vary theta1 and theta2 from 0 to 360 deg at same rate and want to plot updated positions of ain,bin,cin while o2,o4 are fixed on axes input_axis and output_axes respectively.
it is a 3d mechanism,ain is rotating about input_axis and bin is rotating about output_axis and cin is also updating which joins to updated positions of ain and bin.
Please someone tell ,how to animate this mechanism properly!!
Thanks in this attached code i want to vary theta1 and theta2 from 0 to 360 deg at same rate and want to plot updated positions of ain,bin,cin while o2,o4 are fixed on axes input_axis and output_axes respectively.
it is a 3d mechanism,ain is rotating about input_axis and bin is rotating about output_axis and cin is also updating which joins to updated positions of ain and bin.
Please someone tell ,how to animate this mechanism properly!!
Thanks #animation, #mechanism MATLAB Answers — New Questions
How to run “fitrsvm” command in Matlab R2014b?
I am currently using Matlab R2014b, it doent support command "fitrsvm". I have to use Support Vector Machine. Kindly suggest me, how can i run my code using this command? As I am using this older version of Matlab.
Thank you.I am currently using Matlab R2014b, it doent support command "fitrsvm". I have to use Support Vector Machine. Kindly suggest me, how can i run my code using this command? As I am using this older version of Matlab.
Thank you. I am currently using Matlab R2014b, it doent support command "fitrsvm". I have to use Support Vector Machine. Kindly suggest me, how can i run my code using this command? As I am using this older version of Matlab.
Thank you. svm, svr, support vector machine, r2014b MATLAB Answers — New Questions
Change localized help to English
When opening the documentation in Matlab (e.g., by typing "doc subplot" the command window), Matlab opens a localized, i.e., German, version of the online help (because I am based in Germany). My Matlab UI is in English, though.
Is there a way to set the language of the online help to English, such that it automatically always displays the English content?When opening the documentation in Matlab (e.g., by typing "doc subplot" the command window), Matlab opens a localized, i.e., German, version of the online help (because I am based in Germany). My Matlab UI is in English, though.
Is there a way to set the language of the online help to English, such that it automatically always displays the English content? When opening the documentation in Matlab (e.g., by typing "doc subplot" the command window), Matlab opens a localized, i.e., German, version of the online help (because I am based in Germany). My Matlab UI is in English, though.
Is there a way to set the language of the online help to English, such that it automatically always displays the English content? language, help, documentation MATLAB Answers — New Questions
Windows insider build ran into a problem
Hi tech experts,
i have problem with my laptop.When I use my laptop every 5-10 minutes my laptop restart on its own. And shows an error code
“Your windows insider build ran in to a problem and need to restart. We’re just collecting some error info and then we will restart for you.
Stop code : KERNEL SECURITY CHECK FAILURE
What failed : srvnet.sys “
I hope anyone here can help me to solve this issue,
Thanks,
Hi tech experts, i have problem with my laptop.When I use my laptop every 5-10 minutes my laptop restart on its own. And shows an error code”Your windows insider build ran in to a problem and need to restart. We’re just collecting some error info and then we will restart for you. Stop code : KERNEL SECURITY CHECK FAILUREWhat failed : srvnet.sys ” I hope anyone here can help me to solve this issue, Thanks, Read More
Can you compile a MATLAB Linux exe using the Windows 10 Linux Subsystem? If so, how?
I work on a Windows machine but need to produce Linux executable files. I know that compiling an exe on a Windows machine will give you a Windows exe and compiling a Linux machine will produce a Linux exe, but I was wondering if there is a workaround for this using the Windows 10 Linux Subsystem.I work on a Windows machine but need to produce Linux executable files. I know that compiling an exe on a Windows machine will give you a Windows exe and compiling a Linux machine will produce a Linux exe, but I was wondering if there is a workaround for this using the Windows 10 Linux Subsystem. I work on a Windows machine but need to produce Linux executable files. I know that compiling an exe on a Windows machine will give you a Windows exe and compiling a Linux machine will produce a Linux exe, but I was wondering if there is a workaround for this using the Windows 10 Linux Subsystem. executable, linux, windows 10, subsystem, exe MATLAB Answers — New Questions
How to change author for git commits?
Hi, is there a way to change the author which shows up when doing a commit in the Git integration in a MATLAB/Simulink Project?
To what kind of property of the host machine is it linked?
Thank youHi, is there a way to change the author which shows up when doing a commit in the Git integration in a MATLAB/Simulink Project?
To what kind of property of the host machine is it linked?
Thank you Hi, is there a way to change the author which shows up when doing a commit in the Git integration in a MATLAB/Simulink Project?
To what kind of property of the host machine is it linked?
Thank you git, author, matlab, simulink, project, projects MATLAB Answers — New Questions
How do I find the x and y coordinates of a fitted Gaussian curve at a given slope?
I have written a code that fits my data with a Gaussian curve. I need to be able to set a baseline for multiple images with the same defined parameter then caluclate the full width-half maximum and slope between the baseline and maximum for each curve. What I’m thinking is to define the baseline as the point where the slope of the curve is equal to -1 (or another value). There may be other ways to do this, but it just needs to be consistant over all trials.
My code is:
clear
I=3; sumon=0; %holds variable of images to be added%
for k=[7:9]; %loop to add images together%
on{k}=imread(sprintf(‘on_ %d.tif’,k)); %reads on files at _k%
on{k}=double(on{k}); %stores variable as 64 bit, double precision floating variable%
sumon=sumon+(on{k}); %adds image k to previous image%
end %end for loop%
on=sumon/I %averages images taken%
sumoff=0; I=3; %holds variable of images to be added%
for k=[4:6]; %loop to add images together%
off{k}=imread(sprintf(‘off_ %d.tif’,k));%reads on files at _k%
off{k}=double(off{k}); %stores variable as 64 bit, double precision floating variable%
sumoff=sumoff+(off{k}); %adds image k to previous image%
end %end for loop%
off=sumoff/I %averages images taken%
result=on-off %subtracts averaged off image from average on image%
imshow(result) %shows result%
% rotate
result=imrotate(result,-93,’bilinear’)
%crop image
result=imcrop(result, [100, 450, 800, 200])
%show image
imshow(result)
%% Plotting intensity vs x pixel index
vertsum = sum(result, 1)
vertsum =vertsum-max(vertsum)
% Set data points
[xData, yData] = prepareCurveData( [], vertsum );
% Set up fittype and options.
ft = fittype( ‘gauss2’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.Lower = [-Inf -Inf 0 -Inf -Inf 0];
opts.StartPoint = [0 301 300 0 601 300];
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘untitled fit 1’ );
h = plot( fitresult, xData, yData );
legend( h, ‘vertsum’, ‘Gaussian fit’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
ylabel( ‘vertsum’, ‘Interpreter’, ‘none’ );
grid on
I’ve also included a picture of the resulting curve. In this case I’d like the baseline to be set at ~150,-3, and the maximum at -350, -15. I already have it written to culculate the FWHM and slope between these points if I just manually set the baseline. Thanks!I have written a code that fits my data with a Gaussian curve. I need to be able to set a baseline for multiple images with the same defined parameter then caluclate the full width-half maximum and slope between the baseline and maximum for each curve. What I’m thinking is to define the baseline as the point where the slope of the curve is equal to -1 (or another value). There may be other ways to do this, but it just needs to be consistant over all trials.
My code is:
clear
I=3; sumon=0; %holds variable of images to be added%
for k=[7:9]; %loop to add images together%
on{k}=imread(sprintf(‘on_ %d.tif’,k)); %reads on files at _k%
on{k}=double(on{k}); %stores variable as 64 bit, double precision floating variable%
sumon=sumon+(on{k}); %adds image k to previous image%
end %end for loop%
on=sumon/I %averages images taken%
sumoff=0; I=3; %holds variable of images to be added%
for k=[4:6]; %loop to add images together%
off{k}=imread(sprintf(‘off_ %d.tif’,k));%reads on files at _k%
off{k}=double(off{k}); %stores variable as 64 bit, double precision floating variable%
sumoff=sumoff+(off{k}); %adds image k to previous image%
end %end for loop%
off=sumoff/I %averages images taken%
result=on-off %subtracts averaged off image from average on image%
imshow(result) %shows result%
% rotate
result=imrotate(result,-93,’bilinear’)
%crop image
result=imcrop(result, [100, 450, 800, 200])
%show image
imshow(result)
%% Plotting intensity vs x pixel index
vertsum = sum(result, 1)
vertsum =vertsum-max(vertsum)
% Set data points
[xData, yData] = prepareCurveData( [], vertsum );
% Set up fittype and options.
ft = fittype( ‘gauss2’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.Lower = [-Inf -Inf 0 -Inf -Inf 0];
opts.StartPoint = [0 301 300 0 601 300];
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘untitled fit 1’ );
h = plot( fitresult, xData, yData );
legend( h, ‘vertsum’, ‘Gaussian fit’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
ylabel( ‘vertsum’, ‘Interpreter’, ‘none’ );
grid on
I’ve also included a picture of the resulting curve. In this case I’d like the baseline to be set at ~150,-3, and the maximum at -350, -15. I already have it written to culculate the FWHM and slope between these points if I just manually set the baseline. Thanks! I have written a code that fits my data with a Gaussian curve. I need to be able to set a baseline for multiple images with the same defined parameter then caluclate the full width-half maximum and slope between the baseline and maximum for each curve. What I’m thinking is to define the baseline as the point where the slope of the curve is equal to -1 (or another value). There may be other ways to do this, but it just needs to be consistant over all trials.
My code is:
clear
I=3; sumon=0; %holds variable of images to be added%
for k=[7:9]; %loop to add images together%
on{k}=imread(sprintf(‘on_ %d.tif’,k)); %reads on files at _k%
on{k}=double(on{k}); %stores variable as 64 bit, double precision floating variable%
sumon=sumon+(on{k}); %adds image k to previous image%
end %end for loop%
on=sumon/I %averages images taken%
sumoff=0; I=3; %holds variable of images to be added%
for k=[4:6]; %loop to add images together%
off{k}=imread(sprintf(‘off_ %d.tif’,k));%reads on files at _k%
off{k}=double(off{k}); %stores variable as 64 bit, double precision floating variable%
sumoff=sumoff+(off{k}); %adds image k to previous image%
end %end for loop%
off=sumoff/I %averages images taken%
result=on-off %subtracts averaged off image from average on image%
imshow(result) %shows result%
% rotate
result=imrotate(result,-93,’bilinear’)
%crop image
result=imcrop(result, [100, 450, 800, 200])
%show image
imshow(result)
%% Plotting intensity vs x pixel index
vertsum = sum(result, 1)
vertsum =vertsum-max(vertsum)
% Set data points
[xData, yData] = prepareCurveData( [], vertsum );
% Set up fittype and options.
ft = fittype( ‘gauss2’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.Lower = [-Inf -Inf 0 -Inf -Inf 0];
opts.StartPoint = [0 301 300 0 601 300];
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘untitled fit 1’ );
h = plot( fitresult, xData, yData );
legend( h, ‘vertsum’, ‘Gaussian fit’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
ylabel( ‘vertsum’, ‘Interpreter’, ‘none’ );
grid on
I’ve also included a picture of the resulting curve. In this case I’d like the baseline to be set at ~150,-3, and the maximum at -350, -15. I already have it written to culculate the FWHM and slope between these points if I just manually set the baseline. Thanks! slope, gaussian MATLAB Answers — New Questions
Output of system function in Linux
Dear all,
I would like to execute the following system command
[~, res] = system([‘TERM=xterm git -c color.ui=false show –pretty="%cd"’])
to get some information about git. However, the result looks like this
‘�[?1h�=
Wed Mar 8 12:19:18 2017 +0200�[m
�[m
�[K�[?1l�>’
I would like to get rid of these escape characters starting with square brackets. I already disabled the colouring of the output, because I suspected this to be responsible, but that didn’t seem to be the problem. Does it make sense to select a different type of terminal? Or is this maybe some kind of conversion problem?
Thanks!Dear all,
I would like to execute the following system command
[~, res] = system([‘TERM=xterm git -c color.ui=false show –pretty="%cd"’])
to get some information about git. However, the result looks like this
‘�[?1h�=
Wed Mar 8 12:19:18 2017 +0200�[m
�[m
�[K�[?1l�>’
I would like to get rid of these escape characters starting with square brackets. I already disabled the colouring of the output, because I suspected this to be responsible, but that didn’t seem to be the problem. Does it make sense to select a different type of terminal? Or is this maybe some kind of conversion problem?
Thanks! Dear all,
I would like to execute the following system command
[~, res] = system([‘TERM=xterm git -c color.ui=false show –pretty="%cd"’])
to get some information about git. However, the result looks like this
‘�[?1h�=
Wed Mar 8 12:19:18 2017 +0200�[m
�[m
�[K�[?1l�>’
I would like to get rid of these escape characters starting with square brackets. I already disabled the colouring of the output, because I suspected this to be responsible, but that didn’t seem to be the problem. Does it make sense to select a different type of terminal? Or is this maybe some kind of conversion problem?
Thanks! system, linux, git MATLAB Answers — New Questions
Why is the FPGA image for UHD different?
Hello,
I am using Matlab 2024A – update 4 with Communications Toolbox for UHD (B210 hardware). I noticed that the FPGA image download for the B210-UHD is different. What is the difference between the UHD image from Ettus and the Mathworks FPGA image?
Here is the line from my Matlab session.
linux; GNU C++ version 10.3.0; Boost_107800; UHD_4.2.0.0-vendor
UHD_4.2.0.0-vendor seems unique to Mathworks, is this correct?Hello,
I am using Matlab 2024A – update 4 with Communications Toolbox for UHD (B210 hardware). I noticed that the FPGA image download for the B210-UHD is different. What is the difference between the UHD image from Ettus and the Mathworks FPGA image?
Here is the line from my Matlab session.
linux; GNU C++ version 10.3.0; Boost_107800; UHD_4.2.0.0-vendor
UHD_4.2.0.0-vendor seems unique to Mathworks, is this correct? Hello,
I am using Matlab 2024A – update 4 with Communications Toolbox for UHD (B210 hardware). I noticed that the FPGA image download for the B210-UHD is different. What is the difference between the UHD image from Ettus and the Mathworks FPGA image?
Here is the line from my Matlab session.
linux; GNU C++ version 10.3.0; Boost_107800; UHD_4.2.0.0-vendor
UHD_4.2.0.0-vendor seems unique to Mathworks, is this correct? uhd, fpga MATLAB Answers — New Questions
Solving a system of ODEs whose coefficients are piecewise functions
I try to plot the solution of a system of ODE, on [-10,10], for the initial data [0.001 0.001], using the function:
function dwdt=systode(t,w)
if 0< t<1
f = t*(3-2*t);
if -1<t< 0
f=t*(3+2*t);
else
f = 1/t;
end;
if 0< t <1
h=4*t^4-12*t^3+9*t^2-4*t+3;
if -1< t < 0
h=4*t^4+12*t^3+9*t^2+4*t+3;
else
h=0;
end;
beta=0.5+exp(-abs(t));
dwdt=zeros(2,1);
dwdt(1)=-f*w(1)+w(2);
dwdt(2)=-beta*w(1)-f*w(2)+h*w(1)-f*w(1)^2;
end
The coefficients f(t) and g(t) are piecewise functions as follows.
With the commands
tspan = [-10 10];
z0=[0.001 0.001];
[t,z] = ode45(@(t,z) systode(t,z), tspan, z0);
figure
plot(t,z(:,1),’r’);
I get the message
tspan = [-10 10];
↑
Error: Invalid use of operator.
Where could be the mistake? I am also not sure that I defined correctly the functions f, h, .I try to plot the solution of a system of ODE, on [-10,10], for the initial data [0.001 0.001], using the function:
function dwdt=systode(t,w)
if 0< t<1
f = t*(3-2*t);
if -1<t< 0
f=t*(3+2*t);
else
f = 1/t;
end;
if 0< t <1
h=4*t^4-12*t^3+9*t^2-4*t+3;
if -1< t < 0
h=4*t^4+12*t^3+9*t^2+4*t+3;
else
h=0;
end;
beta=0.5+exp(-abs(t));
dwdt=zeros(2,1);
dwdt(1)=-f*w(1)+w(2);
dwdt(2)=-beta*w(1)-f*w(2)+h*w(1)-f*w(1)^2;
end
The coefficients f(t) and g(t) are piecewise functions as follows.
With the commands
tspan = [-10 10];
z0=[0.001 0.001];
[t,z] = ode45(@(t,z) systode(t,z), tspan, z0);
figure
plot(t,z(:,1),’r’);
I get the message
tspan = [-10 10];
↑
Error: Invalid use of operator.
Where could be the mistake? I am also not sure that I defined correctly the functions f, h, . I try to plot the solution of a system of ODE, on [-10,10], for the initial data [0.001 0.001], using the function:
function dwdt=systode(t,w)
if 0< t<1
f = t*(3-2*t);
if -1<t< 0
f=t*(3+2*t);
else
f = 1/t;
end;
if 0< t <1
h=4*t^4-12*t^3+9*t^2-4*t+3;
if -1< t < 0
h=4*t^4+12*t^3+9*t^2+4*t+3;
else
h=0;
end;
beta=0.5+exp(-abs(t));
dwdt=zeros(2,1);
dwdt(1)=-f*w(1)+w(2);
dwdt(2)=-beta*w(1)-f*w(2)+h*w(1)-f*w(1)^2;
end
The coefficients f(t) and g(t) are piecewise functions as follows.
With the commands
tspan = [-10 10];
z0=[0.001 0.001];
[t,z] = ode45(@(t,z) systode(t,z), tspan, z0);
figure
plot(t,z(:,1),’r’);
I get the message
tspan = [-10 10];
↑
Error: Invalid use of operator.
Where could be the mistake? I am also not sure that I defined correctly the functions f, h, . ode45 MATLAB Answers — New Questions
Upcoming Pearson Partner Store Office Hours (End of Fiscal)
End of Microsoft’s fiscal year is generally a time when we see an increase in certification exam voucher orders. This year, the Pearson team is hosting 3 office hours for any partners who may have questions about orders (or questions in general). If you have questions, feel free to join one of the meetings via the attached calendar invites.
Option 1: Tuesday June 25, 6:00 – 6:50 AM Pacific
Option 2: Tuesday June 25, 7:00 – 7:50 PM Pacific
Option 3: Thursday June 27, 6:30 – 7:20 AM Pacific
Thanks for your support.
End of Microsoft’s fiscal year is generally a time when we see an increase in certification exam voucher orders. This year, the Pearson team is hosting 3 office hours for any partners who may have questions about orders (or questions in general). If you have questions, feel free to join one of the meetings via the attached calendar invites.
Option 1: Tuesday June 25, 6:00 – 6:50 AM Pacific
Option 2: Tuesday June 25, 7:00 – 7:50 PM Pacific
Option 3: Thursday June 27, 6:30 – 7:20 AM Pacific
Thanks for your support. Read More
How to show the output on the right side of the coding pane?
Please help to show the result on the right side as bottom image.Please help to show the result on the right side as bottom image. Please help to show the result on the right side as bottom image. output, matlab MATLAB Answers — New Questions
Add Microsoft Teams to a SharePoint Site
Hello
Please i need your help on this issue.
I need help to add Teams to SharePoint.
Hello Please i need your help on this issue. I need help to add Teams to SharePoint. Read More
Inverse huge matrix with tall array
Hi,
I am trying to find x in my system Ax=b. A is a huge matrix, it is a size of 10 billion *9, and out of my memory, b is 10 billion *1 vector.
Therefore, I am using tall array, while I don know how to compute the inverse of A? (pseudo inverse)
One answer is here, while it is incorrect: https://uk.mathworks.com/matlabcentral/answers/530823-taking-the-inverse-of-a-tall-array-to-solve-a-linear-system-of-equations
A = tall(ds);
b_t = tall(ones(1,1));
SOL = gather(Ab);
This code works with SOL is 9*1 vector, however, the vector b_t has all elements equal to 1.
If I use my verctor b, it shows an error with incompatible tall array argument in tall/qrLeftSolve.
Any one can help this case?
Thanks in advance.Hi,
I am trying to find x in my system Ax=b. A is a huge matrix, it is a size of 10 billion *9, and out of my memory, b is 10 billion *1 vector.
Therefore, I am using tall array, while I don know how to compute the inverse of A? (pseudo inverse)
One answer is here, while it is incorrect: https://uk.mathworks.com/matlabcentral/answers/530823-taking-the-inverse-of-a-tall-array-to-solve-a-linear-system-of-equations
A = tall(ds);
b_t = tall(ones(1,1));
SOL = gather(Ab);
This code works with SOL is 9*1 vector, however, the vector b_t has all elements equal to 1.
If I use my verctor b, it shows an error with incompatible tall array argument in tall/qrLeftSolve.
Any one can help this case?
Thanks in advance. Hi,
I am trying to find x in my system Ax=b. A is a huge matrix, it is a size of 10 billion *9, and out of my memory, b is 10 billion *1 vector.
Therefore, I am using tall array, while I don know how to compute the inverse of A? (pseudo inverse)
One answer is here, while it is incorrect: https://uk.mathworks.com/matlabcentral/answers/530823-taking-the-inverse-of-a-tall-array-to-solve-a-linear-system-of-equations
A = tall(ds);
b_t = tall(ones(1,1));
SOL = gather(Ab);
This code works with SOL is 9*1 vector, however, the vector b_t has all elements equal to 1.
If I use my verctor b, it shows an error with incompatible tall array argument in tall/qrLeftSolve.
Any one can help this case?
Thanks in advance. matrix array MATLAB Answers — New Questions
Related to Deployment on TMSF2803X boards
I have a TDC1000 C2000 EVM With me,but on hardware deployment it is showing an error like "failed to upload the executable to evm". What could be the reason. It had TMSF28035 Processor in it . It’s showing in simulink also,but board name not shownI have a TDC1000 C2000 EVM With me,but on hardware deployment it is showing an error like "failed to upload the executable to evm". What could be the reason. It had TMSF28035 Processor in it . It’s showing in simulink also,but board name not shown I have a TDC1000 C2000 EVM With me,but on hardware deployment it is showing an error like "failed to upload the executable to evm". What could be the reason. It had TMSF28035 Processor in it . It’s showing in simulink also,but board name not shown c2000, tdc1000 MATLAB Answers — New Questions
How to make a revolute joint turn in one direction in Simscape?
Hello all,
I am building a bicycle on Simscape. The tyres are connected to axles which in turn are connected to the bicycle frame, and I used a revolute joint to connect the tyre and the axle (as shown in the picture below). I would like my tyres to only turn in one direction (clockwise) but it always turn in both senses when I simulate it. I saw another post saying that we needed to put a Rigid Transform before and after the Revolute joint to change its direction and I tried it but it didn’t work (the only thing it did was make the tyre go clockwise or counter-clockwise at first depending on the rotation parameters of the joint, but the tyre still kept going both senses).
Could someone help me on this matter please? I am still new to Matlab and Simscape and I am learning new things and how to use it as I progress in my project, but that problem has kept me stuck for quite some time now.
Thank you very much.
Here is a screenshot of the model built with Simscape Multibody. I apologize for the the way it looks as it is quite messy but I hope you can still understand it.Hello all,
I am building a bicycle on Simscape. The tyres are connected to axles which in turn are connected to the bicycle frame, and I used a revolute joint to connect the tyre and the axle (as shown in the picture below). I would like my tyres to only turn in one direction (clockwise) but it always turn in both senses when I simulate it. I saw another post saying that we needed to put a Rigid Transform before and after the Revolute joint to change its direction and I tried it but it didn’t work (the only thing it did was make the tyre go clockwise or counter-clockwise at first depending on the rotation parameters of the joint, but the tyre still kept going both senses).
Could someone help me on this matter please? I am still new to Matlab and Simscape and I am learning new things and how to use it as I progress in my project, but that problem has kept me stuck for quite some time now.
Thank you very much.
Here is a screenshot of the model built with Simscape Multibody. I apologize for the the way it looks as it is quite messy but I hope you can still understand it. Hello all,
I am building a bicycle on Simscape. The tyres are connected to axles which in turn are connected to the bicycle frame, and I used a revolute joint to connect the tyre and the axle (as shown in the picture below). I would like my tyres to only turn in one direction (clockwise) but it always turn in both senses when I simulate it. I saw another post saying that we needed to put a Rigid Transform before and after the Revolute joint to change its direction and I tried it but it didn’t work (the only thing it did was make the tyre go clockwise or counter-clockwise at first depending on the rotation parameters of the joint, but the tyre still kept going both senses).
Could someone help me on this matter please? I am still new to Matlab and Simscape and I am learning new things and how to use it as I progress in my project, but that problem has kept me stuck for quite some time now.
Thank you very much.
Here is a screenshot of the model built with Simscape Multibody. I apologize for the the way it looks as it is quite messy but I hope you can still understand it. revolute joint, tyre, wheel, one sense MATLAB Answers — New Questions
% Complete vs Physical % Complete
Is there some way to make the % Complete field represent the Physical % Complete? That is to say for the % complete to only reflect the status in the work effort field regardless of the duration.
For example:
IF Total Effort = 10 hours & Completed Effort = 5 hours (as would remaining effort)
THEN % Compete =50%
REGARDLESS of whether the duration says 3 months.
Currently the automated calculations always factor in the duration and it’s not what I’m after.
Cheers
Is there some way to make the % Complete field represent the Physical % Complete? That is to say for the % complete to only reflect the status in the work effort field regardless of the duration. For example:IF Total Effort = 10 hours & Completed Effort = 5 hours (as would remaining effort)THEN % Compete =50%REGARDLESS of whether the duration says 3 months. Currently the automated calculations always factor in the duration and it’s not what I’m after. Cheers Read More
Excel Cell percentage from another cell’s fraction (4/8)
I Have a attendance sheet that is out of 10 weeks, and a seperate formula to colour each week’s attendance from red to green etc. At the end of the 10 weeks there is a column that represents the total amount of weeks present (example, 4/10) with the function of (‘4/10) to not change to a date. Next to this column is another column with a precentage, for example (4/10 = 40%) is there any way i can make this automatic so when i update the /10 scale, the percentage updates automatically?
I Have a attendance sheet that is out of 10 weeks, and a seperate formula to colour each week’s attendance from red to green etc. At the end of the 10 weeks there is a column that represents the total amount of weeks present (example, 4/10) with the function of (‘4/10) to not change to a date. Next to this column is another column with a precentage, for example (4/10 = 40%) is there any way i can make this automatic so when i update the /10 scale, the percentage updates automatically? Read More
FAQ: Multiyear contract with increasing pricing
Q: I have a SaaS solution which has the following requirements for its pricing:
3-year contracts, with prices for the 3 years previously agreed upon
The prices agreed upon are different every year (e.g. year 1 100$, year 2 120$, year 3 150$)
No metered billing
I want to work with private offers
Ideally, offers renews automatically every year for 3 years, and the price agreed upon at the beginning is set for the year.
Would I need to create 1-year private offers and upgrade them every year?
A: You will need 3 private offers, one for each year where you specify the prices for the year.
Each private offers has the appropriate StartDate – EndDate to cover the 1 year period it represents (year1, 2, or 3)
All 3 private offers are sent to the customer at the beginning of the term, all 3 are accepted.
Customer then makes one subscription with auto-renewal on so that the offer gets charged and processed every year at the price of the private offer that is in effect at the time of renewal
Q: I have a SaaS solution which has the following requirements for its pricing:
3-year contracts, with prices for the 3 years previously agreed upon
The prices agreed upon are different every year (e.g. year 1 100$, year 2 120$, year 3 150$)
No metered billing
I want to work with private offers
Ideally, offers renews automatically every year for 3 years, and the price agreed upon at the beginning is set for the year.
Would I need to create 1-year private offers and upgrade them every year?
A: You will need 3 private offers, one for each year where you specify the prices for the year.
Each private offers has the appropriate StartDate – EndDate to cover the 1 year period it represents (year1, 2, or 3)
All 3 private offers are sent to the customer at the beginning of the term, all 3 are accepted.
Customer then makes one subscription with auto-renewal on so that the offer gets charged and processed every year at the price of the private offer that is in effect at the time of renewal
Read More