Tag Archives: matlab
How do I fix this error?
deltat=0.1;
nsamples=2^10;
fs=1/deltat;
time=[0 : deltat : deltat*(nsamples-1)];
psdtot(1:nsamples/2+1) = zeros(1,nsamples/2+1);
nblock = 10;
for k=1:nblock
for i=1: nsamples
ydata(i,:) =5+10*cos(2*pi*time+pi/6)+15* randn(1);
end
[pxx,f] = periodogram(ydata,rectwin(nsamples),nsamples,fs);
size(psdtot)
size(pxx)
psdtot = psdtot + pxx/nblock;
end
figure(1);
plot(time,ydata);
I’m trying to generate Gaussian noise from x(t)=5+10*cos(2*pi*t+pi/6)+G(sigma,t)
G(sigma,t) is Gaussian noise with a standard deviation of 15 (sigma G=15), detat=0.1(s), and nsample=2^10.
It is the start of calculating Power Spectral Density with FFT.
The overall variance of the signal is (sigma g)^2+(A)^2/2 as expected.
The generated random signal should be sinusoidal because X(t) has the cosine factor.deltat=0.1;
nsamples=2^10;
fs=1/deltat;
time=[0 : deltat : deltat*(nsamples-1)];
psdtot(1:nsamples/2+1) = zeros(1,nsamples/2+1);
nblock = 10;
for k=1:nblock
for i=1: nsamples
ydata(i,:) =5+10*cos(2*pi*time+pi/6)+15* randn(1);
end
[pxx,f] = periodogram(ydata,rectwin(nsamples),nsamples,fs);
size(psdtot)
size(pxx)
psdtot = psdtot + pxx/nblock;
end
figure(1);
plot(time,ydata);
I’m trying to generate Gaussian noise from x(t)=5+10*cos(2*pi*t+pi/6)+G(sigma,t)
G(sigma,t) is Gaussian noise with a standard deviation of 15 (sigma G=15), detat=0.1(s), and nsample=2^10.
It is the start of calculating Power Spectral Density with FFT.
The overall variance of the signal is (sigma g)^2+(A)^2/2 as expected.
The generated random signal should be sinusoidal because X(t) has the cosine factor. deltat=0.1;
nsamples=2^10;
fs=1/deltat;
time=[0 : deltat : deltat*(nsamples-1)];
psdtot(1:nsamples/2+1) = zeros(1,nsamples/2+1);
nblock = 10;
for k=1:nblock
for i=1: nsamples
ydata(i,:) =5+10*cos(2*pi*time+pi/6)+15* randn(1);
end
[pxx,f] = periodogram(ydata,rectwin(nsamples),nsamples,fs);
size(psdtot)
size(pxx)
psdtot = psdtot + pxx/nblock;
end
figure(1);
plot(time,ydata);
I’m trying to generate Gaussian noise from x(t)=5+10*cos(2*pi*t+pi/6)+G(sigma,t)
G(sigma,t) is Gaussian noise with a standard deviation of 15 (sigma G=15), detat=0.1(s), and nsample=2^10.
It is the start of calculating Power Spectral Density with FFT.
The overall variance of the signal is (sigma g)^2+(A)^2/2 as expected.
The generated random signal should be sinusoidal because X(t) has the cosine factor. predefine the array MATLAB Answers — New Questions
Thermal Image analysis on legs
I am trying to edit the below code so that it gives me an image of the area selected that is above the average temperature of the lower limb.
I would be grateful for any tips
clc;
close all;
clear;
workspace;
format long g;
format compact;
% Read the thermal image
thermalImage = imread(‘thermal_image_side_leg_2 .jpeg’); % Replace ‘thermal_image.jpg’ with the filename of your thermal image
% Display the thermal image
figure;
imshow(thermalImage);
title(‘Original Thermal Image’);
% Convert the thermal image to grayscale
thermalImageGray = rgb2gray(thermalImage);
% Display the grayscale thermal image
figure;
imshow(thermalImageGray);
title(‘Grayscale Thermal Image’);
% Select the area of interest using the imfreehand function
figure;
imshow(thermalImageGray);
title(‘Select Area of Interest’);
roi = imfreehand; % This allows you to draw a freehand region of interest (ROI) on the grayscale thermal image
binaryMask = createMask(roi);
% Apply the binary mask to the grayscale image
maskedGrayImage = thermalImageGray .* uint8(binaryMask);
% Display the masked grayscale image
figure;
imshow(maskedGrayImage);
title(‘Masked Grayscale Image’);
% Define the temperature scale using the color bar
colorBarImage = imread(‘Color_bar_side_leg_2.png’); % Replace ‘colorbar_image.jpg’ with the filename of your color bar image
temperatureRange = [26, 38]; % Replace with the temperature range provided by the color bar
% Calibrate the masked grayscale image using the temperature range
calibratedImage = (double(maskedGrayImage) – double(min(thermalImageGray(:)))) * (temperatureRange(2) – temperatureRange(1)) / (double(max(thermalImageGray(:))) – double(min(thermalImageGray(:)))) + temperatureRange(1);
% Display the calibrated image
figure;
imshow(calibratedImage);
title(‘Calibrated Image’);
% Calculate the average temperature of the ROI
averageTemperature = mean(calibratedImage(binaryMask));
% Display the average temperature
disp([‘The average temperature of the selected area is: ‘, num2str(averageTemperature), ‘ °C’]);
% Calculate the average temperature of the ROI
averageTemperature = mean(calibratedImage(binaryMask));
% Display the average temperature
disp([‘The average temperature of the selected area is: ‘, num2str(averageTemperature), ‘ °C’]);
% Threshold the calibrated image to create a binary mask for temperatures above the average
binaryAboveAverage = calibratedImage > averageTemperature;
% Display the binary mask
figure;
imshow(binaryAboveAverage);
title(‘Areas above Average Temperature’);
% Apply the binary mask to the original image
thresholdedImage = thermalImage;
thresholdedImage(repmat(~binaryAboveAverage, [1, 1, 3])) = 0;
% Display the thresholded image
figure;
imshow(thresholdedImage);
title(‘Thresholded Image’);I am trying to edit the below code so that it gives me an image of the area selected that is above the average temperature of the lower limb.
I would be grateful for any tips
clc;
close all;
clear;
workspace;
format long g;
format compact;
% Read the thermal image
thermalImage = imread(‘thermal_image_side_leg_2 .jpeg’); % Replace ‘thermal_image.jpg’ with the filename of your thermal image
% Display the thermal image
figure;
imshow(thermalImage);
title(‘Original Thermal Image’);
% Convert the thermal image to grayscale
thermalImageGray = rgb2gray(thermalImage);
% Display the grayscale thermal image
figure;
imshow(thermalImageGray);
title(‘Grayscale Thermal Image’);
% Select the area of interest using the imfreehand function
figure;
imshow(thermalImageGray);
title(‘Select Area of Interest’);
roi = imfreehand; % This allows you to draw a freehand region of interest (ROI) on the grayscale thermal image
binaryMask = createMask(roi);
% Apply the binary mask to the grayscale image
maskedGrayImage = thermalImageGray .* uint8(binaryMask);
% Display the masked grayscale image
figure;
imshow(maskedGrayImage);
title(‘Masked Grayscale Image’);
% Define the temperature scale using the color bar
colorBarImage = imread(‘Color_bar_side_leg_2.png’); % Replace ‘colorbar_image.jpg’ with the filename of your color bar image
temperatureRange = [26, 38]; % Replace with the temperature range provided by the color bar
% Calibrate the masked grayscale image using the temperature range
calibratedImage = (double(maskedGrayImage) – double(min(thermalImageGray(:)))) * (temperatureRange(2) – temperatureRange(1)) / (double(max(thermalImageGray(:))) – double(min(thermalImageGray(:)))) + temperatureRange(1);
% Display the calibrated image
figure;
imshow(calibratedImage);
title(‘Calibrated Image’);
% Calculate the average temperature of the ROI
averageTemperature = mean(calibratedImage(binaryMask));
% Display the average temperature
disp([‘The average temperature of the selected area is: ‘, num2str(averageTemperature), ‘ °C’]);
% Calculate the average temperature of the ROI
averageTemperature = mean(calibratedImage(binaryMask));
% Display the average temperature
disp([‘The average temperature of the selected area is: ‘, num2str(averageTemperature), ‘ °C’]);
% Threshold the calibrated image to create a binary mask for temperatures above the average
binaryAboveAverage = calibratedImage > averageTemperature;
% Display the binary mask
figure;
imshow(binaryAboveAverage);
title(‘Areas above Average Temperature’);
% Apply the binary mask to the original image
thresholdedImage = thermalImage;
thresholdedImage(repmat(~binaryAboveAverage, [1, 1, 3])) = 0;
% Display the thresholded image
figure;
imshow(thresholdedImage);
title(‘Thresholded Image’); I am trying to edit the below code so that it gives me an image of the area selected that is above the average temperature of the lower limb.
I would be grateful for any tips
clc;
close all;
clear;
workspace;
format long g;
format compact;
% Read the thermal image
thermalImage = imread(‘thermal_image_side_leg_2 .jpeg’); % Replace ‘thermal_image.jpg’ with the filename of your thermal image
% Display the thermal image
figure;
imshow(thermalImage);
title(‘Original Thermal Image’);
% Convert the thermal image to grayscale
thermalImageGray = rgb2gray(thermalImage);
% Display the grayscale thermal image
figure;
imshow(thermalImageGray);
title(‘Grayscale Thermal Image’);
% Select the area of interest using the imfreehand function
figure;
imshow(thermalImageGray);
title(‘Select Area of Interest’);
roi = imfreehand; % This allows you to draw a freehand region of interest (ROI) on the grayscale thermal image
binaryMask = createMask(roi);
% Apply the binary mask to the grayscale image
maskedGrayImage = thermalImageGray .* uint8(binaryMask);
% Display the masked grayscale image
figure;
imshow(maskedGrayImage);
title(‘Masked Grayscale Image’);
% Define the temperature scale using the color bar
colorBarImage = imread(‘Color_bar_side_leg_2.png’); % Replace ‘colorbar_image.jpg’ with the filename of your color bar image
temperatureRange = [26, 38]; % Replace with the temperature range provided by the color bar
% Calibrate the masked grayscale image using the temperature range
calibratedImage = (double(maskedGrayImage) – double(min(thermalImageGray(:)))) * (temperatureRange(2) – temperatureRange(1)) / (double(max(thermalImageGray(:))) – double(min(thermalImageGray(:)))) + temperatureRange(1);
% Display the calibrated image
figure;
imshow(calibratedImage);
title(‘Calibrated Image’);
% Calculate the average temperature of the ROI
averageTemperature = mean(calibratedImage(binaryMask));
% Display the average temperature
disp([‘The average temperature of the selected area is: ‘, num2str(averageTemperature), ‘ °C’]);
% Calculate the average temperature of the ROI
averageTemperature = mean(calibratedImage(binaryMask));
% Display the average temperature
disp([‘The average temperature of the selected area is: ‘, num2str(averageTemperature), ‘ °C’]);
% Threshold the calibrated image to create a binary mask for temperatures above the average
binaryAboveAverage = calibratedImage > averageTemperature;
% Display the binary mask
figure;
imshow(binaryAboveAverage);
title(‘Areas above Average Temperature’);
% Apply the binary mask to the original image
thresholdedImage = thermalImage;
thresholdedImage(repmat(~binaryAboveAverage, [1, 1, 3])) = 0;
% Display the thresholded image
figure;
imshow(thresholdedImage);
title(‘Thresholded Image’); thermal image MATLAB Answers — New Questions
Deep learning: predict and forward give very inconsistent result with batch normalisation
Hi there,
I have a dnn with BatchNormalization layers. I did [Uf, statef] = forward(dnn_net, XT); "statef" returned from forward call should contain the learned mean and variance of the BN layers. I then update the dnn_net.State = statef so that the dnn_net.State is updated with the learned mean and var from the forward call. Then I did Up = predict(dnn_net,XT) [on the same data XT as the forward call]. Then I compare the mse(Up,Uf) and it turns out to be quite large (e.g 2.xx). This is totally not expected. Please help
I have created a simple test script to show the problem below:
numLayer = 9;
numNeurons = 80;
layers = featureInputLayer(2);% 2 input features
for i = 1:numLayer-1
layers = [
layers
fullyConnectedLayer(numNeurons)
batchNormalizationLayer
geluLayer
];
end
layers = [
layers
fullyConnectedLayer(4)];
dnn_net = dlnetwork(layers,’Initialize’,true);
dnn_net = expandLayers(dnn_net);% expand the layers in residual blocks
dnn_net = dlupdate(@double,dnn_net);
X = 2*pi*dlarray(randn(1,1000),"CB");
T = 2*pi*dlarray(randn(1,1000),"CB");
XT = cat(1,X,T);
% compute DNN output using forward function, statef contains
% batchnormlayers (learned means and learned var)
[Uf,statef] = forward(dnn_net,XT);
dnn_net.State = statef;% update the dnn_net.State (so that it has the BN layers updated learned means and var
Up = predict(dnn_net,XT);
% DNN output between predict call and forward call shoudl be the same in
% this case (becausae the dnn_net.State is updated with the same learned mean/var from forward calls.
% However, it is not the case. The err is quite large
plot(Uf(1,:),’r-‘);hold on; plot(Up(1,:),’b-‘);
err = mse(Uf(1,:),Up(1,:))Hi there,
I have a dnn with BatchNormalization layers. I did [Uf, statef] = forward(dnn_net, XT); "statef" returned from forward call should contain the learned mean and variance of the BN layers. I then update the dnn_net.State = statef so that the dnn_net.State is updated with the learned mean and var from the forward call. Then I did Up = predict(dnn_net,XT) [on the same data XT as the forward call]. Then I compare the mse(Up,Uf) and it turns out to be quite large (e.g 2.xx). This is totally not expected. Please help
I have created a simple test script to show the problem below:
numLayer = 9;
numNeurons = 80;
layers = featureInputLayer(2);% 2 input features
for i = 1:numLayer-1
layers = [
layers
fullyConnectedLayer(numNeurons)
batchNormalizationLayer
geluLayer
];
end
layers = [
layers
fullyConnectedLayer(4)];
dnn_net = dlnetwork(layers,’Initialize’,true);
dnn_net = expandLayers(dnn_net);% expand the layers in residual blocks
dnn_net = dlupdate(@double,dnn_net);
X = 2*pi*dlarray(randn(1,1000),"CB");
T = 2*pi*dlarray(randn(1,1000),"CB");
XT = cat(1,X,T);
% compute DNN output using forward function, statef contains
% batchnormlayers (learned means and learned var)
[Uf,statef] = forward(dnn_net,XT);
dnn_net.State = statef;% update the dnn_net.State (so that it has the BN layers updated learned means and var
Up = predict(dnn_net,XT);
% DNN output between predict call and forward call shoudl be the same in
% this case (becausae the dnn_net.State is updated with the same learned mean/var from forward calls.
% However, it is not the case. The err is quite large
plot(Uf(1,:),’r-‘);hold on; plot(Up(1,:),’b-‘);
err = mse(Uf(1,:),Up(1,:)) Hi there,
I have a dnn with BatchNormalization layers. I did [Uf, statef] = forward(dnn_net, XT); "statef" returned from forward call should contain the learned mean and variance of the BN layers. I then update the dnn_net.State = statef so that the dnn_net.State is updated with the learned mean and var from the forward call. Then I did Up = predict(dnn_net,XT) [on the same data XT as the forward call]. Then I compare the mse(Up,Uf) and it turns out to be quite large (e.g 2.xx). This is totally not expected. Please help
I have created a simple test script to show the problem below:
numLayer = 9;
numNeurons = 80;
layers = featureInputLayer(2);% 2 input features
for i = 1:numLayer-1
layers = [
layers
fullyConnectedLayer(numNeurons)
batchNormalizationLayer
geluLayer
];
end
layers = [
layers
fullyConnectedLayer(4)];
dnn_net = dlnetwork(layers,’Initialize’,true);
dnn_net = expandLayers(dnn_net);% expand the layers in residual blocks
dnn_net = dlupdate(@double,dnn_net);
X = 2*pi*dlarray(randn(1,1000),"CB");
T = 2*pi*dlarray(randn(1,1000),"CB");
XT = cat(1,X,T);
% compute DNN output using forward function, statef contains
% batchnormlayers (learned means and learned var)
[Uf,statef] = forward(dnn_net,XT);
dnn_net.State = statef;% update the dnn_net.State (so that it has the BN layers updated learned means and var
Up = predict(dnn_net,XT);
% DNN output between predict call and forward call shoudl be the same in
% this case (becausae the dnn_net.State is updated with the same learned mean/var from forward calls.
% However, it is not the case. The err is quite large
plot(Uf(1,:),’r-‘);hold on; plot(Up(1,:),’b-‘);
err = mse(Uf(1,:),Up(1,:)) predict and forward gives inconsistent outputs MATLAB Answers — New Questions
how to save variable data that we changed ?
this is my code:
nSamp = 3251;
Fs = 1024e3;
SNR = 40;
rng default
t = (0:nSamp-1)’/Fs;
x = sin(2*pi*t*100.123e3);
x = x + randn(size(x))*std(x)/db2mag(SNR);
[Pxx,f] = periodogram(x,kaiser(nSamp,38),[],Fs);
meanfreq(Pxx,f);
i change the variable in this code to my dataset . then after run, the variable go to its original data . how to solve this problem?this is my code:
nSamp = 3251;
Fs = 1024e3;
SNR = 40;
rng default
t = (0:nSamp-1)’/Fs;
x = sin(2*pi*t*100.123e3);
x = x + randn(size(x))*std(x)/db2mag(SNR);
[Pxx,f] = periodogram(x,kaiser(nSamp,38),[],Fs);
meanfreq(Pxx,f);
i change the variable in this code to my dataset . then after run, the variable go to its original data . how to solve this problem? this is my code:
nSamp = 3251;
Fs = 1024e3;
SNR = 40;
rng default
t = (0:nSamp-1)’/Fs;
x = sin(2*pi*t*100.123e3);
x = x + randn(size(x))*std(x)/db2mag(SNR);
[Pxx,f] = periodogram(x,kaiser(nSamp,38),[],Fs);
meanfreq(Pxx,f);
i change the variable in this code to my dataset . then after run, the variable go to its original data . how to solve this problem? change and save variables MATLAB Answers — New Questions
Estimation of average angles based on quadrants
Hello, I would appreaciate any suggestion to estimate the total average of angles based on the location of the quadrants. The length of the matrix of the angles to assess the average is variable and for these examples I am assuming that the length of the matrices are constant:
angles=[2;355;0;6]
I should have the following answer for the average:
average_angle=0.75;
% Another case:
angles=[-2;350;0;-3 ]
average=356.25;
% another case
angles=[5;36;45;-5]
average=110.25
% another case
angles=[35;36;45;50]
average=41.5
% another case
angles=[180;150;-8;130]
average=203
I would appreciate the help if there is a quick command in Matlab to do these operations without having too many conditions.Hello, I would appreaciate any suggestion to estimate the total average of angles based on the location of the quadrants. The length of the matrix of the angles to assess the average is variable and for these examples I am assuming that the length of the matrices are constant:
angles=[2;355;0;6]
I should have the following answer for the average:
average_angle=0.75;
% Another case:
angles=[-2;350;0;-3 ]
average=356.25;
% another case
angles=[5;36;45;-5]
average=110.25
% another case
angles=[35;36;45;50]
average=41.5
% another case
angles=[180;150;-8;130]
average=203
I would appreciate the help if there is a quick command in Matlab to do these operations without having too many conditions. Hello, I would appreaciate any suggestion to estimate the total average of angles based on the location of the quadrants. The length of the matrix of the angles to assess the average is variable and for these examples I am assuming that the length of the matrices are constant:
angles=[2;355;0;6]
I should have the following answer for the average:
average_angle=0.75;
% Another case:
angles=[-2;350;0;-3 ]
average=356.25;
% another case
angles=[5;36;45;-5]
average=110.25
% another case
angles=[35;36;45;50]
average=41.5
% another case
angles=[180;150;-8;130]
average=203
I would appreciate the help if there is a quick command in Matlab to do these operations without having too many conditions. average estimation of angles bases on quadrants MATLAB Answers — New Questions
How to make convergence criteria for Levenberg-Marquardt algorithm
How to make convergence criteria for Levenberg-Marquardt algorithm, please give practical hint for matlab implementatioHow to make convergence criteria for Levenberg-Marquardt algorithm, please give practical hint for matlab implementatio How to make convergence criteria for Levenberg-Marquardt algorithm, please give practical hint for matlab implementatio levenberg-marquardt, convergence MATLAB Answers — New Questions
Inertia axes in an image
I have to evaluate the symmetry of this nevus, you can see his binary image.
I have found the centroid, would you give me an advise for the code to find and show the inertia axis of the image which match each other in the centroid?
I would have to align them with x and y axis of the image with a rotation then.
Thank youI have to evaluate the symmetry of this nevus, you can see his binary image.
I have found the centroid, would you give me an advise for the code to find and show the inertia axis of the image which match each other in the centroid?
I would have to align them with x and y axis of the image with a rotation then.
Thank you I have to evaluate the symmetry of this nevus, you can see his binary image.
I have found the centroid, would you give me an advise for the code to find and show the inertia axis of the image which match each other in the centroid?
I would have to align them with x and y axis of the image with a rotation then.
Thank you inertia, axis MATLAB Answers — New Questions
matlab r2014a에서 ‘gwr’은(는) 유형 ‘struct’의 입력 인수에 대해 정의되지 않은 함수입니다.
matlab r2014a에서 ‘gwr’은(는) 유형 ‘struct’의 입력 인수에 대해 정의되지 않은 함수입니다.
라고 경고문이 뜨는데 , gwr을 하기 위해서는 어떻게 해야하나요?
%=============GWR ANALYSIS========%
%=============exponential weight========%
info.dtype=’exponential’;
res1=gwr(ln_sale,x,xc,yc,info);
prt(res1, vnames);
more on;matlab r2014a에서 ‘gwr’은(는) 유형 ‘struct’의 입력 인수에 대해 정의되지 않은 함수입니다.
라고 경고문이 뜨는데 , gwr을 하기 위해서는 어떻게 해야하나요?
%=============GWR ANALYSIS========%
%=============exponential weight========%
info.dtype=’exponential’;
res1=gwr(ln_sale,x,xc,yc,info);
prt(res1, vnames);
more on; matlab r2014a에서 ‘gwr’은(는) 유형 ‘struct’의 입력 인수에 대해 정의되지 않은 함수입니다.
라고 경고문이 뜨는데 , gwr을 하기 위해서는 어떻게 해야하나요?
%=============GWR ANALYSIS========%
%=============exponential weight========%
info.dtype=’exponential’;
res1=gwr(ln_sale,x,xc,yc,info);
prt(res1, vnames);
more on; gwr, gwr struct MATLAB Answers — New Questions
I want to install an MATLAB 2024 Update 6 but it is only showing Update 2 do I have to reinstall?
I have MATLAB 2024a installed (it has update 2) — it shows that no updates are available when I check for updates in the GUI. I just received an email from MATHWORKS that I bug I reported has been fixed in UPDATE 6. When I go to the licenses to install this update, it seems to be saying that I need to uninstall the previous version and start over. Is this really what I need to do? Seems unreasonable…..I have MATLAB 2024a installed (it has update 2) — it shows that no updates are available when I check for updates in the GUI. I just received an email from MATHWORKS that I bug I reported has been fixed in UPDATE 6. When I go to the licenses to install this update, it seems to be saying that I need to uninstall the previous version and start over. Is this really what I need to do? Seems unreasonable….. I have MATLAB 2024a installed (it has update 2) — it shows that no updates are available when I check for updates in the GUI. I just received an email from MATHWORKS that I bug I reported has been fixed in UPDATE 6. When I go to the licenses to install this update, it seems to be saying that I need to uninstall the previous version and start over. Is this really what I need to do? Seems unreasonable….. update installation MATLAB Answers — New Questions
paretosearch does not satisfy nonlinear constraints
I want to make V<=0.001 at a position where Wn=1, but the non-linear constraint cannot do it. I am sure there is this answer. The following is my program。
https://drive.mathworks.com/sharing/df23a873-b7f8-420c-b085-dedccef7860cI want to make V<=0.001 at a position where Wn=1, but the non-linear constraint cannot do it. I am sure there is this answer. The following is my program。
https://drive.mathworks.com/sharing/df23a873-b7f8-420c-b085-dedccef7860c I want to make V<=0.001 at a position where Wn=1, but the non-linear constraint cannot do it. I am sure there is this answer. The following is my program。
https://drive.mathworks.com/sharing/df23a873-b7f8-420c-b085-dedccef7860c multi-objective optimization MATLAB Answers — New Questions
What is the maximum size of *.mat file?
What is the maximum size of *.mat file?
What is the maximum size of HDF5 file?What is the maximum size of *.mat file?
What is the maximum size of HDF5 file? What is the maximum size of *.mat file?
What is the maximum size of HDF5 file? mat file MATLAB Answers — New Questions
Is this a bug of MATLAB?
% Here is my code
[vpa(str2sym(‘asin(1)*2’),100);vpa(str2sym(‘pi’),100)]
The output is:
3.1415926535897932384626433832795
3.1415926535897932384626433832795
I think the correct answer should be longer. Is it a bug or an expected behavior?% Here is my code
[vpa(str2sym(‘asin(1)*2’),100);vpa(str2sym(‘pi’),100)]
The output is:
3.1415926535897932384626433832795
3.1415926535897932384626433832795
I think the correct answer should be longer. Is it a bug or an expected behavior? % Here is my code
[vpa(str2sym(‘asin(1)*2’),100);vpa(str2sym(‘pi’),100)]
The output is:
3.1415926535897932384626433832795
3.1415926535897932384626433832795
I think the correct answer should be longer. Is it a bug or an expected behavior? symbolic, matlab, mathematics MATLAB Answers — New Questions
Working With Inverse of Polynomials
Hello, this is my first post in this form and I am new to MatLab. I would like to take the inverse of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form.Hello, this is my first post in this form and I am new to MatLab. I would like to take the inverse of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form. Hello, this is my first post in this form and I am new to MatLab. I would like to take the inverse of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form. polynomial MATLAB Answers — New Questions
Simscape forces and torques: Centrifugal, gravitational, accelerative
Goodafternoon ‘u all,
I’m actually working with simscape and I was wondering if any way exist to get from a multibody model acting forces components, ad function of kinematic conditions. In simpler words, how can I get centrifugal, coriolis, gravitations, and accelerative forces components action on a mass or body of the system? Let’s assume as first approximation we’re working with rigid body (but I imagine would be in any case a good approximation also for other cases). I don’t see any evident methd for getting them easily, unless repeating all required onerous calculations (futile to say I’m not going for :-D). In robotic toolbox all these components are directly derived from internal jacobians and kinematcs conditions. I was guessing any similar feature also exist in simscape. Remarks, I’m currently using simscape under simulink environment.
Suggestions?
Best regardsGoodafternoon ‘u all,
I’m actually working with simscape and I was wondering if any way exist to get from a multibody model acting forces components, ad function of kinematic conditions. In simpler words, how can I get centrifugal, coriolis, gravitations, and accelerative forces components action on a mass or body of the system? Let’s assume as first approximation we’re working with rigid body (but I imagine would be in any case a good approximation also for other cases). I don’t see any evident methd for getting them easily, unless repeating all required onerous calculations (futile to say I’m not going for :-D). In robotic toolbox all these components are directly derived from internal jacobians and kinematcs conditions. I was guessing any similar feature also exist in simscape. Remarks, I’m currently using simscape under simulink environment.
Suggestions?
Best regards Goodafternoon ‘u all,
I’m actually working with simscape and I was wondering if any way exist to get from a multibody model acting forces components, ad function of kinematic conditions. In simpler words, how can I get centrifugal, coriolis, gravitations, and accelerative forces components action on a mass or body of the system? Let’s assume as first approximation we’re working with rigid body (but I imagine would be in any case a good approximation also for other cases). I don’t see any evident methd for getting them easily, unless repeating all required onerous calculations (futile to say I’m not going for :-D). In robotic toolbox all these components are directly derived from internal jacobians and kinematcs conditions. I was guessing any similar feature also exist in simscape. Remarks, I’m currently using simscape under simulink environment.
Suggestions?
Best regards simscape, multibody, forces MATLAB Answers — New Questions
Plotting Complex Functions.
I intend to do a taylor series expansion at t=0. I would like to plot the coefficients of each Taylor term in the complex plane, using the surf function.
I tried Taylor(F) , Series (F) somewhere there is an error. The function is product of two gaussians, with two parameters mentioned above. This Gaussian contains other constants, Some are symbolic, while some have pre determined values.
Can some one help me out.
Thanks.I intend to do a taylor series expansion at t=0. I would like to plot the coefficients of each Taylor term in the complex plane, using the surf function.
I tried Taylor(F) , Series (F) somewhere there is an error. The function is product of two gaussians, with two parameters mentioned above. This Gaussian contains other constants, Some are symbolic, while some have pre determined values.
Can some one help me out.
Thanks. I intend to do a taylor series expansion at t=0. I would like to plot the coefficients of each Taylor term in the complex plane, using the surf function.
I tried Taylor(F) , Series (F) somewhere there is an error. The function is product of two gaussians, with two parameters mentioned above. This Gaussian contains other constants, Some are symbolic, while some have pre determined values.
Can some one help me out.
Thanks. complex intergaration, taylor series MATLAB Answers — New Questions
Plot grraph , srink is problem
the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,’o’,x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248])the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,’o’,x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248]) the following code is plot the graph I want to change the Y axis value so that the box and plot on x -axis does concide , I try it using limit commmand but it just srink the graph
x=-1000:25:975
u_exact=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
u_RDTM=[-9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.25E-08 -9.25E-08 -9.26E-08 -9.27E-08 -9.28E-08 -9.31E-08 -9.36E-08 -9.45E-08 -9.63E-08 -1.00E-07 -1.12E-07 -1.75E-07 -4.18134E+12 -1.77E-07 -1.12E-07 -1.00E-07 -9.63E-08 -9.45E-08 -9.36E-08 -9.31E-08 -9.28E-08 -9.27E-08 -9.26E-08 -9.25E-08 -9.25E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08 -9.24E-08]
plot(x,u_RDTM,’o’,x,u_exact)
xlim([-1844 2054])
ylim([-6950633103752 1818593846248]) graphiical representation MATLAB Answers — New Questions
Syntax error , Component: Simulink, Category: Block error
I am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) – g*m*sin(u(3)) – M*g*sin(u(3)))/(l*(M + m – m*cos(u(3))^2))
I would like to know correct format for above formulas.
Thank you, AaronI am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) – g*m*sin(u(3)) – M*g*sin(u(3)))/(l*(M + m – m*cos(u(3))^2))
I would like to know correct format for above formulas.
Thank you, Aaron I am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) – g*m*sin(u(3)) – M*g*sin(u(3)))/(l*(M + m – m*cos(u(3))^2))
I would like to know correct format for above formulas.
Thank you, Aaron simulink, block error MATLAB Answers — New Questions
boolean to double signals
hello
I want to create PWM signal generator blocks in Simulink which has blanking time also. but i have problem with finding the right block and configuration. I used "Transport delay" or "Variable Time delay" or "dead zone". there is the problem with boolean to double signal in varible time delay and transpor delay.
please help me
thankshello
I want to create PWM signal generator blocks in Simulink which has blanking time also. but i have problem with finding the right block and configuration. I used "Transport delay" or "Variable Time delay" or "dead zone". there is the problem with boolean to double signal in varible time delay and transpor delay.
please help me
thanks hello
I want to create PWM signal generator blocks in Simulink which has blanking time also. but i have problem with finding the right block and configuration. I used "Transport delay" or "Variable Time delay" or "dead zone". there is the problem with boolean to double signal in varible time delay and transpor delay.
please help me
thanks simulink MATLAB Answers — New Questions
how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn’t getting how to solve the abovehow to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn’t getting how to solve the above how to modify a variable data by scale function like data= scale(data); I have to modify scale function for variable data
Actually i am writing a matlab code for training in Matlan onramp and didn’t getting how to solve the above create a function, modify a function MATLAB Answers — New Questions
How can I calculate the forces and moments on servo arms and couplers in a Stewart platform simulation using MATLAB
I am currently working on developing a Stewart platform and have calculated the inverse kinematic. I’ve also created a Simscape Multibody simulation, utilizing revolute joints (driven by angle inputs), brick solids, and spherical joints. From this simulation, I extracted the joint torques necessary to drive the top platform based on a given input trajectory. This data has helped me select appropriate motors and spherical joints.
Now, I need to determine the forces and moments applied to the servo arms and couplers. My goal is to ensure that the servo arms do not twist and the couplers do not buckle under load. Could you advise on how I can calculate these forces and moments using MATLAB, or would it be more appropriate to use another tool for this analysis?
The mechanical members in question are highlighted in the attached pictures.I am currently working on developing a Stewart platform and have calculated the inverse kinematic. I’ve also created a Simscape Multibody simulation, utilizing revolute joints (driven by angle inputs), brick solids, and spherical joints. From this simulation, I extracted the joint torques necessary to drive the top platform based on a given input trajectory. This data has helped me select appropriate motors and spherical joints.
Now, I need to determine the forces and moments applied to the servo arms and couplers. My goal is to ensure that the servo arms do not twist and the couplers do not buckle under load. Could you advise on how I can calculate these forces and moments using MATLAB, or would it be more appropriate to use another tool for this analysis?
The mechanical members in question are highlighted in the attached pictures. I am currently working on developing a Stewart platform and have calculated the inverse kinematic. I’ve also created a Simscape Multibody simulation, utilizing revolute joints (driven by angle inputs), brick solids, and spherical joints. From this simulation, I extracted the joint torques necessary to drive the top platform based on a given input trajectory. This data has helped me select appropriate motors and spherical joints.
Now, I need to determine the forces and moments applied to the servo arms and couplers. My goal is to ensure that the servo arms do not twist and the couplers do not buckle under load. Could you advise on how I can calculate these forces and moments using MATLAB, or would it be more appropriate to use another tool for this analysis?
The mechanical members in question are highlighted in the attached pictures. simscape, matlab, force analysis, simulink, inverse kinematics, stuart’s platform MATLAB Answers — New Questions