Month: June 2024
pearsrnd and pearspdf are not coherent for the Pearson IV distribution?
We are having some trouble using the Pearson 4 implementation of the functions pearsrnd, pearspdf and pearscdf.
We think that pearsrnd does not generate samples from the distribution defined in pearspdf. In particular, we’ve found that pearsrnd over generates observations in the tails of the distribution.
In order to see this, we’ve implemented two simple tests:
1. We’ve compared the PDF of the Pearson 4 distribution (using pearspdf) to the PDF obtained from a simulation using pearsrnd, but we’ve found that the two are very different (even with a very long sample). This problem doesn’t happen for other distributions. In particular, we’ve implemented the same test with the Pearson 6, and the results are satisfactory.
2. In addition, to test if the generatated sample is compatible with its CDF, we’ve applied the function pearscdf to the generated sample. We should have got a uniform distribution, because if X is a random variable and F its CDF, then F(X) is uniform in [0,1]. This is indeed what we’ve got with the Pearson 6, as expected, but not what we’ve got using the Pearson 4.
We’ve conducted a similar experiment using Mathematica, and we get the correct result.
We’ve attached the code we’ve used.
Any idea why we’re getting this result?
Thank you very much.
%% Seed
rng(123)
%% Parameters
%Type IV
mu4 = 5;
sigma4 = 1;
skew4 = 1;
kurt4 = 10;
% Check the distribution type
[ign, type4] = pearsrnd(mu4, sigma4, skew4, kurt4, 1);
disp("This Pearson is of type " + type4)
% Type VI
mu6 = 2;
sigma6 = 1;
skew6 = 2;
kurt6 = 10;
% Check the distribution type
[ign, type6] = pearsrnd(mu6, sigma6, skew6, kurt6, 1);
disp("This Pearson is of type " + type6)
%% Simulate n observations according to both Pearson distributions defined above
n = 100000;
samples4 = pearsrnd(mu4, sigma4, skew4, kurt4, 1, n);
samples6 = pearsrnd(mu6, sigma6, skew6, kurt6, 1, n);
%% First test: we compare the simulated pdf (i.e. histogram of the sample) to the closed form PDF
pdf4 = @(x) pearspdf(x, mu4, sigma4, skew4, kurt4);
pdf6 = @(x) pearspdf(x, mu6, sigma6, skew6, kurt6);
x_ = linspace(-10, 10, 10000);
y4 = pdf4(x_);
y6 = pdf6(x_);
figure(‘Position’, [100, 100, 1000, 400]); % [left, bottom, width, height]
subplot(1, 2, 1);
plot(x_, y4, Color=’red’, LineWidth=2)
title(‘Simulated and closed form PDF for Pearson 4’)
hold on
histogram(samples4, 1000, ‘Normalization’, ‘pdf’, ‘FaceColor’, ‘blue’)
hold off
subplot(1, 2, 2);
plot(x_, y6, Color=’red’, LineWidth=2)
title(‘Simulated and closed form PDF for Pearson 6’)
hold on
histogram(samples6, 1000, ‘Normalization’, ‘pdf’, ‘FaceColor’, ‘blue’)
hold off
sgtitle(‘Test 1: Comparison between Pearson 4 and 6’);
%% Second test: Let X be a random variable and F its CDF, then F(X) is uniform in [0,1].
% We apply the Pearson CDF to the simulated observations and plot its
% histogram. We should obtain something resembling a uniform distribution.
figure(‘Position’, [100, 100, 1000, 400]); % [left, bottom, width, height]
subplot(1, 2, 1);
u4 = pearscdf(samples4, mu4, sigma4, skew4, kurt4);
histogram(u4)
title(‘F(X) for Pearson 4’)
subplot(1, 2, 2);
u6 = pearscdf(samples6, mu6, sigma6, skew6, kurt6);
histogram(u6)
title(‘F(X) for Pearson 6’)
sgtitle(‘Test 2: Comparison between Pearson 4 and 6’);
%% Conclusion
%We get the expected results using the Pearson 6, but we cannot say the
%same for the Pearson 4. Why?We are having some trouble using the Pearson 4 implementation of the functions pearsrnd, pearspdf and pearscdf.
We think that pearsrnd does not generate samples from the distribution defined in pearspdf. In particular, we’ve found that pearsrnd over generates observations in the tails of the distribution.
In order to see this, we’ve implemented two simple tests:
1. We’ve compared the PDF of the Pearson 4 distribution (using pearspdf) to the PDF obtained from a simulation using pearsrnd, but we’ve found that the two are very different (even with a very long sample). This problem doesn’t happen for other distributions. In particular, we’ve implemented the same test with the Pearson 6, and the results are satisfactory.
2. In addition, to test if the generatated sample is compatible with its CDF, we’ve applied the function pearscdf to the generated sample. We should have got a uniform distribution, because if X is a random variable and F its CDF, then F(X) is uniform in [0,1]. This is indeed what we’ve got with the Pearson 6, as expected, but not what we’ve got using the Pearson 4.
We’ve conducted a similar experiment using Mathematica, and we get the correct result.
We’ve attached the code we’ve used.
Any idea why we’re getting this result?
Thank you very much.
%% Seed
rng(123)
%% Parameters
%Type IV
mu4 = 5;
sigma4 = 1;
skew4 = 1;
kurt4 = 10;
% Check the distribution type
[ign, type4] = pearsrnd(mu4, sigma4, skew4, kurt4, 1);
disp("This Pearson is of type " + type4)
% Type VI
mu6 = 2;
sigma6 = 1;
skew6 = 2;
kurt6 = 10;
% Check the distribution type
[ign, type6] = pearsrnd(mu6, sigma6, skew6, kurt6, 1);
disp("This Pearson is of type " + type6)
%% Simulate n observations according to both Pearson distributions defined above
n = 100000;
samples4 = pearsrnd(mu4, sigma4, skew4, kurt4, 1, n);
samples6 = pearsrnd(mu6, sigma6, skew6, kurt6, 1, n);
%% First test: we compare the simulated pdf (i.e. histogram of the sample) to the closed form PDF
pdf4 = @(x) pearspdf(x, mu4, sigma4, skew4, kurt4);
pdf6 = @(x) pearspdf(x, mu6, sigma6, skew6, kurt6);
x_ = linspace(-10, 10, 10000);
y4 = pdf4(x_);
y6 = pdf6(x_);
figure(‘Position’, [100, 100, 1000, 400]); % [left, bottom, width, height]
subplot(1, 2, 1);
plot(x_, y4, Color=’red’, LineWidth=2)
title(‘Simulated and closed form PDF for Pearson 4’)
hold on
histogram(samples4, 1000, ‘Normalization’, ‘pdf’, ‘FaceColor’, ‘blue’)
hold off
subplot(1, 2, 2);
plot(x_, y6, Color=’red’, LineWidth=2)
title(‘Simulated and closed form PDF for Pearson 6’)
hold on
histogram(samples6, 1000, ‘Normalization’, ‘pdf’, ‘FaceColor’, ‘blue’)
hold off
sgtitle(‘Test 1: Comparison between Pearson 4 and 6’);
%% Second test: Let X be a random variable and F its CDF, then F(X) is uniform in [0,1].
% We apply the Pearson CDF to the simulated observations and plot its
% histogram. We should obtain something resembling a uniform distribution.
figure(‘Position’, [100, 100, 1000, 400]); % [left, bottom, width, height]
subplot(1, 2, 1);
u4 = pearscdf(samples4, mu4, sigma4, skew4, kurt4);
histogram(u4)
title(‘F(X) for Pearson 4’)
subplot(1, 2, 2);
u6 = pearscdf(samples6, mu6, sigma6, skew6, kurt6);
histogram(u6)
title(‘F(X) for Pearson 6’)
sgtitle(‘Test 2: Comparison between Pearson 4 and 6’);
%% Conclusion
%We get the expected results using the Pearson 6, but we cannot say the
%same for the Pearson 4. Why? We are having some trouble using the Pearson 4 implementation of the functions pearsrnd, pearspdf and pearscdf.
We think that pearsrnd does not generate samples from the distribution defined in pearspdf. In particular, we’ve found that pearsrnd over generates observations in the tails of the distribution.
In order to see this, we’ve implemented two simple tests:
1. We’ve compared the PDF of the Pearson 4 distribution (using pearspdf) to the PDF obtained from a simulation using pearsrnd, but we’ve found that the two are very different (even with a very long sample). This problem doesn’t happen for other distributions. In particular, we’ve implemented the same test with the Pearson 6, and the results are satisfactory.
2. In addition, to test if the generatated sample is compatible with its CDF, we’ve applied the function pearscdf to the generated sample. We should have got a uniform distribution, because if X is a random variable and F its CDF, then F(X) is uniform in [0,1]. This is indeed what we’ve got with the Pearson 6, as expected, but not what we’ve got using the Pearson 4.
We’ve conducted a similar experiment using Mathematica, and we get the correct result.
We’ve attached the code we’ve used.
Any idea why we’re getting this result?
Thank you very much.
%% Seed
rng(123)
%% Parameters
%Type IV
mu4 = 5;
sigma4 = 1;
skew4 = 1;
kurt4 = 10;
% Check the distribution type
[ign, type4] = pearsrnd(mu4, sigma4, skew4, kurt4, 1);
disp("This Pearson is of type " + type4)
% Type VI
mu6 = 2;
sigma6 = 1;
skew6 = 2;
kurt6 = 10;
% Check the distribution type
[ign, type6] = pearsrnd(mu6, sigma6, skew6, kurt6, 1);
disp("This Pearson is of type " + type6)
%% Simulate n observations according to both Pearson distributions defined above
n = 100000;
samples4 = pearsrnd(mu4, sigma4, skew4, kurt4, 1, n);
samples6 = pearsrnd(mu6, sigma6, skew6, kurt6, 1, n);
%% First test: we compare the simulated pdf (i.e. histogram of the sample) to the closed form PDF
pdf4 = @(x) pearspdf(x, mu4, sigma4, skew4, kurt4);
pdf6 = @(x) pearspdf(x, mu6, sigma6, skew6, kurt6);
x_ = linspace(-10, 10, 10000);
y4 = pdf4(x_);
y6 = pdf6(x_);
figure(‘Position’, [100, 100, 1000, 400]); % [left, bottom, width, height]
subplot(1, 2, 1);
plot(x_, y4, Color=’red’, LineWidth=2)
title(‘Simulated and closed form PDF for Pearson 4’)
hold on
histogram(samples4, 1000, ‘Normalization’, ‘pdf’, ‘FaceColor’, ‘blue’)
hold off
subplot(1, 2, 2);
plot(x_, y6, Color=’red’, LineWidth=2)
title(‘Simulated and closed form PDF for Pearson 6’)
hold on
histogram(samples6, 1000, ‘Normalization’, ‘pdf’, ‘FaceColor’, ‘blue’)
hold off
sgtitle(‘Test 1: Comparison between Pearson 4 and 6’);
%% Second test: Let X be a random variable and F its CDF, then F(X) is uniform in [0,1].
% We apply the Pearson CDF to the simulated observations and plot its
% histogram. We should obtain something resembling a uniform distribution.
figure(‘Position’, [100, 100, 1000, 400]); % [left, bottom, width, height]
subplot(1, 2, 1);
u4 = pearscdf(samples4, mu4, sigma4, skew4, kurt4);
histogram(u4)
title(‘F(X) for Pearson 4’)
subplot(1, 2, 2);
u6 = pearscdf(samples6, mu6, sigma6, skew6, kurt6);
histogram(u6)
title(‘F(X) for Pearson 6’)
sgtitle(‘Test 2: Comparison between Pearson 4 and 6’);
%% Conclusion
%We get the expected results using the Pearson 6, but we cannot say the
%same for the Pearson 4. Why? pearson, distribution, statistics, random number generator, type iv MATLAB Answers — New Questions
fenêtrage d’une image scannographie
si vous plait comment je peux appliquer un fenêtrage sur une image Dicom selon les paramètres de centre de la fenêtre et de largeur de la fenêtre voila les valeurs des paramètres (WL=40 WW=85)si vous plait comment je peux appliquer un fenêtrage sur une image Dicom selon les paramètres de centre de la fenêtre et de largeur de la fenêtre voila les valeurs des paramètres (WL=40 WW=85) si vous plait comment je peux appliquer un fenêtrage sur une image Dicom selon les paramètres de centre de la fenêtre et de largeur de la fenêtre voila les valeurs des paramètres (WL=40 WW=85) dicom, fenetrage, image MATLAB Answers — New Questions
Help! I’m locked out of email because full. But it’s not! Support gives error messages
Help, I am locked out of my main email (hotmail) account. If I try to send email I get:
This message can’t be sent because your mailbox is full.
But I have purchased basic 365 and when it checks it says I’m only using 24% storage.
When I try to contact customer support via web chat I get an error message. I’ve rebooted twice, still stuck.
Any help greatly appreciated!
Help, I am locked out of my main email (hotmail) account. If I try to send email I get:This message can’t be sent because your mailbox is full. But I have purchased basic 365 and when it checks it says I’m only using 24% storage. When I try to contact customer support via web chat I get an error message. I’ve rebooted twice, still stuck. Any help greatly appreciated! Read More
AI COMMUNITY CONFERENCE – NYC 2024
Exciting Announcement: Join Us for a Cutting-Edge AI Community Event in New York City!
Exciting Announcement: Join Us for a Cutting-Edge AI Community Event in New York City! Read More
Cannot access my files in Sharepoint
Hello
Please i need your help on this issue.
My business partner and I can no longer access our business documents in SharePoint Site.
We are getting access errors “Hmmm… can’t reach this pageCheck if there is a typo in netorgft10970333.sharepoint.com”.
We’re concerned our account has been hacked as we haven’t changed anything on our side
Hello Please i need your help on this issue. My business partner and I can no longer access our business documents in SharePoint Site. We are getting access errors “Hmmm… can’t reach this pageCheck if there is a typo in netorgft10970333.sharepoint.com”. We’re concerned our account has been hacked as we haven’t changed anything on our side Read More
The following MATLAB code implements the down-sampling operation with M = 2:
clear all, close all, clc
% Down-sampling
N = 41 ; % Length of the sequence
n = 0:N-1; % Time index
x = 0.6*sin(2*pi*0.0625 *n)+0.3*sin(2*pi*0.2*n); % Original signal
M = 2; % Down-sampling factor
y = x(1:M:N); % Down-sampled signal
Ny = length(y); % Length of the down-sampled sequence
figure
subplot(211),
stem(0:N-1,x(1:N))
xlabel(‘Time index n’), ylabel(‘x[n]’)
subplot(212)
stem(0: Ny -1,y(1: Ny))
xlabel(‘Time index m’), ylabel(‘y[m]’)
clear all, close all, clc
clear all, close all, clc
N = 21 ; % Length of the original sequence
n=0:N-1; % Time index
x=0.6*sin(2*pi*0.0625 *n)+0.3*sin(2*pi*0.2*n); % Original signal
L=2; % Up-sampling factor
y = upsample(x,L); % Up-sampled signal
Ny = length(y); % Length of the up-sampled signal
figure
subplot(2,1,1)
stem(0:N-1,x(1:N))
xlabel(‘Time index n’), ylabel(‘x[n]’)
axis tight
subplot(2,1,2)
stem(0:Ny-1,y(1:Ny))
xlabel(‘Time index m’), ylabel(‘y[m]’)
axis tightclear all, close all, clc
% Down-sampling
N = 41 ; % Length of the sequence
n = 0:N-1; % Time index
x = 0.6*sin(2*pi*0.0625 *n)+0.3*sin(2*pi*0.2*n); % Original signal
M = 2; % Down-sampling factor
y = x(1:M:N); % Down-sampled signal
Ny = length(y); % Length of the down-sampled sequence
figure
subplot(211),
stem(0:N-1,x(1:N))
xlabel(‘Time index n’), ylabel(‘x[n]’)
subplot(212)
stem(0: Ny -1,y(1: Ny))
xlabel(‘Time index m’), ylabel(‘y[m]’)
clear all, close all, clc
clear all, close all, clc
N = 21 ; % Length of the original sequence
n=0:N-1; % Time index
x=0.6*sin(2*pi*0.0625 *n)+0.3*sin(2*pi*0.2*n); % Original signal
L=2; % Up-sampling factor
y = upsample(x,L); % Up-sampled signal
Ny = length(y); % Length of the up-sampled signal
figure
subplot(2,1,1)
stem(0:N-1,x(1:N))
xlabel(‘Time index n’), ylabel(‘x[n]’)
axis tight
subplot(2,1,2)
stem(0:Ny-1,y(1:Ny))
xlabel(‘Time index m’), ylabel(‘y[m]’)
axis tight clear all, close all, clc
% Down-sampling
N = 41 ; % Length of the sequence
n = 0:N-1; % Time index
x = 0.6*sin(2*pi*0.0625 *n)+0.3*sin(2*pi*0.2*n); % Original signal
M = 2; % Down-sampling factor
y = x(1:M:N); % Down-sampled signal
Ny = length(y); % Length of the down-sampled sequence
figure
subplot(211),
stem(0:N-1,x(1:N))
xlabel(‘Time index n’), ylabel(‘x[n]’)
subplot(212)
stem(0: Ny -1,y(1: Ny))
xlabel(‘Time index m’), ylabel(‘y[m]’)
clear all, close all, clc
clear all, close all, clc
N = 21 ; % Length of the original sequence
n=0:N-1; % Time index
x=0.6*sin(2*pi*0.0625 *n)+0.3*sin(2*pi*0.2*n); % Original signal
L=2; % Up-sampling factor
y = upsample(x,L); % Up-sampled signal
Ny = length(y); % Length of the up-sampled signal
figure
subplot(2,1,1)
stem(0:N-1,x(1:N))
xlabel(‘Time index n’), ylabel(‘x[n]’)
axis tight
subplot(2,1,2)
stem(0:Ny-1,y(1:Ny))
xlabel(‘Time index m’), ylabel(‘y[m]’)
axis tight perform decimation/down-sampling using the matlab, the following matlab code implements the up-sampli, notice that the second subplot above contains zero, the next matlab program illustrates the effects of MATLAB Answers — New Questions
Missing msiserver
Running Win 11 Home. windows insider program. MSISERVER is missing, making it unable to install programs requiring that installer.
Running Win 11 Home. windows insider program. MSISERVER is missing, making it unable to install programs requiring that installer. Read More
Vehicle Networking Toolbox setup
I have the Vehicle Networking toolbox for MATLAB and I am trying to make it recognize a Vector CANcaseXL. I have installed the necessary drivers for the CANcaseXL. However, I cannot establish an open channel between the toolbox and the CANcase. Here is the warning message that I received in the Matlab Command window:
>> info = canHWInfo
CAN Devices Detected:
Kvaser Devices:
Virtual 1 Channel 1
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 2)
Use GET on the output of CANHWINFO for more information.
>> canch1 = canChannel(‘Vector’,’CANcaseXL 1′,1)
Warning: The following error was caught while executing ‘can.vector.Channel’ class destructor:
Invalid MEX-file ‘C:Program
FilesMATLABR2010bSP1toolboxvntvntmexVectorXLDriverLibrary.mexw32′: The specified
module could not be found.
I checked the C:Program FilesMATLABR2010bSP1toolboxvntvnt directory and found the right file (mexVectorXLDriverLibrary.mexw32) that needs to be there. If everything was working properly this is what I would see:
>> info = canHWInfo
CAN Devices Detected:
Vector Devices:
CANcaseXL 1 Channel 1 (SN: 24365)
To connect, use – canChannel(‘Vector’, ‘CANcaseXL 1’, 1)
CANcaseXL 1 Channel 2 (SN: 24365)
To connect, use – canChannel(‘Vector’, ‘CANcaseXL 1’, 2)
Virtual 1 Channel 1
To connect, use – canChannel(‘Vector’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Vector’, ‘Virtual 1’, 2)
Kvaser Devices:
Virtual 1 Channel 1
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 2)
Use GET on the output of CANHWINFO for more information.
I called Matlab technical support and they said that this is a Vector driver setup issue. Then I called Vector and they said it was a Matlab issue, help!I have the Vehicle Networking toolbox for MATLAB and I am trying to make it recognize a Vector CANcaseXL. I have installed the necessary drivers for the CANcaseXL. However, I cannot establish an open channel between the toolbox and the CANcase. Here is the warning message that I received in the Matlab Command window:
>> info = canHWInfo
CAN Devices Detected:
Kvaser Devices:
Virtual 1 Channel 1
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 2)
Use GET on the output of CANHWINFO for more information.
>> canch1 = canChannel(‘Vector’,’CANcaseXL 1′,1)
Warning: The following error was caught while executing ‘can.vector.Channel’ class destructor:
Invalid MEX-file ‘C:Program
FilesMATLABR2010bSP1toolboxvntvntmexVectorXLDriverLibrary.mexw32′: The specified
module could not be found.
I checked the C:Program FilesMATLABR2010bSP1toolboxvntvnt directory and found the right file (mexVectorXLDriverLibrary.mexw32) that needs to be there. If everything was working properly this is what I would see:
>> info = canHWInfo
CAN Devices Detected:
Vector Devices:
CANcaseXL 1 Channel 1 (SN: 24365)
To connect, use – canChannel(‘Vector’, ‘CANcaseXL 1’, 1)
CANcaseXL 1 Channel 2 (SN: 24365)
To connect, use – canChannel(‘Vector’, ‘CANcaseXL 1’, 2)
Virtual 1 Channel 1
To connect, use – canChannel(‘Vector’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Vector’, ‘Virtual 1’, 2)
Kvaser Devices:
Virtual 1 Channel 1
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 2)
Use GET on the output of CANHWINFO for more information.
I called Matlab technical support and they said that this is a Vector driver setup issue. Then I called Vector and they said it was a Matlab issue, help! I have the Vehicle Networking toolbox for MATLAB and I am trying to make it recognize a Vector CANcaseXL. I have installed the necessary drivers for the CANcaseXL. However, I cannot establish an open channel between the toolbox and the CANcase. Here is the warning message that I received in the Matlab Command window:
>> info = canHWInfo
CAN Devices Detected:
Kvaser Devices:
Virtual 1 Channel 1
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 2)
Use GET on the output of CANHWINFO for more information.
>> canch1 = canChannel(‘Vector’,’CANcaseXL 1′,1)
Warning: The following error was caught while executing ‘can.vector.Channel’ class destructor:
Invalid MEX-file ‘C:Program
FilesMATLABR2010bSP1toolboxvntvntmexVectorXLDriverLibrary.mexw32′: The specified
module could not be found.
I checked the C:Program FilesMATLABR2010bSP1toolboxvntvnt directory and found the right file (mexVectorXLDriverLibrary.mexw32) that needs to be there. If everything was working properly this is what I would see:
>> info = canHWInfo
CAN Devices Detected:
Vector Devices:
CANcaseXL 1 Channel 1 (SN: 24365)
To connect, use – canChannel(‘Vector’, ‘CANcaseXL 1’, 1)
CANcaseXL 1 Channel 2 (SN: 24365)
To connect, use – canChannel(‘Vector’, ‘CANcaseXL 1’, 2)
Virtual 1 Channel 1
To connect, use – canChannel(‘Vector’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Vector’, ‘Virtual 1’, 2)
Kvaser Devices:
Virtual 1 Channel 1
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 1)
Virtual 1 Channel 2
To connect, use – canChannel(‘Kvaser’, ‘Virtual 1’, 2)
Use GET on the output of CANHWINFO for more information.
I called Matlab technical support and they said that this is a Vector driver setup issue. Then I called Vector and they said it was a Matlab issue, help! mex, vehicle network toolbox, can, usb MATLAB Answers — New Questions
Is rotation matrix for rotating a vector can take any value of angle?
o2 = [0, 0, 0]; % Origin
ain = [1, 0, 0]; % Initial vector
input_axis = [0, 0, 1]; % Axis of rotation (z-axis)
theta = deg2rad(25); % Angle of rotation in radians
% Rotation matrix function
rot_matrix = @(axis, theta) cos(theta) * eye(3) + …
sin(theta) * [0, -axis(3), axis(2); axis(3), 0, -axis(1); -axis(2), axis(1), 0] + …
(1 – cos(theta)) * (axis’ * axis);
% Compute the rotated vector
a_rotated = rot_matrix(input_axis, theta) * (ain – o2)’ + o2′;
% Transpose to row vector for display
a_rotated = a_rotated’;
bin=[3,0,2];
o4=[3,0,-2];
output_axis=[1,0,0];
% Compute the rotated vector in terms of phi
syms phi;
rot_matrix_phi = rot_matrix(output_axis, phi);
bin_o4_rotated = rot_matrix_phi * (bin – o4)’ ;
bin_o4_rotated = bin_o4_rotated’; % Transpose to row vector for display
% Display the symbolic result
disp(‘Rotated bin-o4 in terms of phi:’);
% Display the result
disp(a_rotated)
disp(bin_o4_rotated);
o4o2=o4-o2;
disp(o4o2);
coupler=(o4o2+bin_o4_rotated-a_rotated);
display(coupler);
% Define the initial rotated components of the coupler
syms phi;
coupler = subs(coupler, conj(phi), phi);
%disp(‘Coupler vector without conjugate:’);
disp(coupler);
% Parametric substitution
syms t;
cos_phi = (1 – t^2) / (1 + t^2);
sin_phi = 2 * t / (1 + t^2);
% Substitute parametric forms into coupler components
coupler_parametric = subs(coupler, [cos(phi), sin(phi)], [cos_phi, sin_phi]);
% Display the parametric coupler
disp(‘Parametric form of coupler:’);
disp(coupler_parametric);
%after this stepit is unable to solve for theta more than 91 deg or less than -91 deg
syms targetvalue % it might be 3.5 …
normsq = expand(sum(coupler_parametric.^2) – targetvalue^2);
normpoly = simplify(normsq*(t^2+1)^2);
vpa(expand(normpoly),4);
tsolve = solve(normpoly,t,’maxdegree’,4,’returnconditions’,true);
h=vpa(subs(tsolve.t,targetvalue,3.5));
%disp(h);
real_solutions = h(imag(h) == 0);
disp(‘Real roots:’);
disp(real_solutions);
% Convert real values of t to angles using angle = 2 * atan(t)
angles_rad = 2 * atan(real_solutions);
angles_deg = rad2deg(angles_rad);
% Display angles in degrees
disp(‘Angles in degrees before adjustment:’);
disp(angles_deg);
%please consider that if i take theta(in bold) more than 91 deg or less than -91 deg instead of 25 then it is not giving me the output(means angles_deg),is it the problem with my code or rotation matrix?o2 = [0, 0, 0]; % Origin
ain = [1, 0, 0]; % Initial vector
input_axis = [0, 0, 1]; % Axis of rotation (z-axis)
theta = deg2rad(25); % Angle of rotation in radians
% Rotation matrix function
rot_matrix = @(axis, theta) cos(theta) * eye(3) + …
sin(theta) * [0, -axis(3), axis(2); axis(3), 0, -axis(1); -axis(2), axis(1), 0] + …
(1 – cos(theta)) * (axis’ * axis);
% Compute the rotated vector
a_rotated = rot_matrix(input_axis, theta) * (ain – o2)’ + o2′;
% Transpose to row vector for display
a_rotated = a_rotated’;
bin=[3,0,2];
o4=[3,0,-2];
output_axis=[1,0,0];
% Compute the rotated vector in terms of phi
syms phi;
rot_matrix_phi = rot_matrix(output_axis, phi);
bin_o4_rotated = rot_matrix_phi * (bin – o4)’ ;
bin_o4_rotated = bin_o4_rotated’; % Transpose to row vector for display
% Display the symbolic result
disp(‘Rotated bin-o4 in terms of phi:’);
% Display the result
disp(a_rotated)
disp(bin_o4_rotated);
o4o2=o4-o2;
disp(o4o2);
coupler=(o4o2+bin_o4_rotated-a_rotated);
display(coupler);
% Define the initial rotated components of the coupler
syms phi;
coupler = subs(coupler, conj(phi), phi);
%disp(‘Coupler vector without conjugate:’);
disp(coupler);
% Parametric substitution
syms t;
cos_phi = (1 – t^2) / (1 + t^2);
sin_phi = 2 * t / (1 + t^2);
% Substitute parametric forms into coupler components
coupler_parametric = subs(coupler, [cos(phi), sin(phi)], [cos_phi, sin_phi]);
% Display the parametric coupler
disp(‘Parametric form of coupler:’);
disp(coupler_parametric);
%after this stepit is unable to solve for theta more than 91 deg or less than -91 deg
syms targetvalue % it might be 3.5 …
normsq = expand(sum(coupler_parametric.^2) – targetvalue^2);
normpoly = simplify(normsq*(t^2+1)^2);
vpa(expand(normpoly),4);
tsolve = solve(normpoly,t,’maxdegree’,4,’returnconditions’,true);
h=vpa(subs(tsolve.t,targetvalue,3.5));
%disp(h);
real_solutions = h(imag(h) == 0);
disp(‘Real roots:’);
disp(real_solutions);
% Convert real values of t to angles using angle = 2 * atan(t)
angles_rad = 2 * atan(real_solutions);
angles_deg = rad2deg(angles_rad);
% Display angles in degrees
disp(‘Angles in degrees before adjustment:’);
disp(angles_deg);
%please consider that if i take theta(in bold) more than 91 deg or less than -91 deg instead of 25 then it is not giving me the output(means angles_deg),is it the problem with my code or rotation matrix? o2 = [0, 0, 0]; % Origin
ain = [1, 0, 0]; % Initial vector
input_axis = [0, 0, 1]; % Axis of rotation (z-axis)
theta = deg2rad(25); % Angle of rotation in radians
% Rotation matrix function
rot_matrix = @(axis, theta) cos(theta) * eye(3) + …
sin(theta) * [0, -axis(3), axis(2); axis(3), 0, -axis(1); -axis(2), axis(1), 0] + …
(1 – cos(theta)) * (axis’ * axis);
% Compute the rotated vector
a_rotated = rot_matrix(input_axis, theta) * (ain – o2)’ + o2′;
% Transpose to row vector for display
a_rotated = a_rotated’;
bin=[3,0,2];
o4=[3,0,-2];
output_axis=[1,0,0];
% Compute the rotated vector in terms of phi
syms phi;
rot_matrix_phi = rot_matrix(output_axis, phi);
bin_o4_rotated = rot_matrix_phi * (bin – o4)’ ;
bin_o4_rotated = bin_o4_rotated’; % Transpose to row vector for display
% Display the symbolic result
disp(‘Rotated bin-o4 in terms of phi:’);
% Display the result
disp(a_rotated)
disp(bin_o4_rotated);
o4o2=o4-o2;
disp(o4o2);
coupler=(o4o2+bin_o4_rotated-a_rotated);
display(coupler);
% Define the initial rotated components of the coupler
syms phi;
coupler = subs(coupler, conj(phi), phi);
%disp(‘Coupler vector without conjugate:’);
disp(coupler);
% Parametric substitution
syms t;
cos_phi = (1 – t^2) / (1 + t^2);
sin_phi = 2 * t / (1 + t^2);
% Substitute parametric forms into coupler components
coupler_parametric = subs(coupler, [cos(phi), sin(phi)], [cos_phi, sin_phi]);
% Display the parametric coupler
disp(‘Parametric form of coupler:’);
disp(coupler_parametric);
%after this stepit is unable to solve for theta more than 91 deg or less than -91 deg
syms targetvalue % it might be 3.5 …
normsq = expand(sum(coupler_parametric.^2) – targetvalue^2);
normpoly = simplify(normsq*(t^2+1)^2);
vpa(expand(normpoly),4);
tsolve = solve(normpoly,t,’maxdegree’,4,’returnconditions’,true);
h=vpa(subs(tsolve.t,targetvalue,3.5));
%disp(h);
real_solutions = h(imag(h) == 0);
disp(‘Real roots:’);
disp(real_solutions);
% Convert real values of t to angles using angle = 2 * atan(t)
angles_rad = 2 * atan(real_solutions);
angles_deg = rad2deg(angles_rad);
% Display angles in degrees
disp(‘Angles in degrees before adjustment:’);
disp(angles_deg);
%please consider that if i take theta(in bold) more than 91 deg or less than -91 deg instead of 25 then it is not giving me the output(means angles_deg),is it the problem with my code or rotation matrix? vector, rotation MATLAB Answers — New Questions
I am getting a #Name error
I am getting a #Name error. I need help. I have try trim removing any extra spaces. I am not sure what to do.
Thanks You
I am getting a #Name error. I need help. I have try trim removing any extra spaces. I am not sure what to do. Thanks You Read More
how can I find the intersect point of 1 plot and a yline ?
x = [0 10 20 30 40 50 60 70 80 90];
y = [0 0.0328 0.2521 0.7975 1.7295 3.0213 4.5714 6.2283 7.8191 9.1752];
plot(x,y,’LineWidth’,2);
hold on
yline(5, ‘r’);
xlim([0 90]);
ylim([0 9.1752]);x = [0 10 20 30 40 50 60 70 80 90];
y = [0 0.0328 0.2521 0.7975 1.7295 3.0213 4.5714 6.2283 7.8191 9.1752];
plot(x,y,’LineWidth’,2);
hold on
yline(5, ‘r’);
xlim([0 90]);
ylim([0 9.1752]); x = [0 10 20 30 40 50 60 70 80 90];
y = [0 0.0328 0.2521 0.7975 1.7295 3.0213 4.5714 6.2283 7.8191 9.1752];
plot(x,y,’LineWidth’,2);
hold on
yline(5, ‘r’);
xlim([0 90]);
ylim([0 9.1752]); matlab, plot, plotting MATLAB Answers — New Questions
timeout on thingSpeakRead, no data read
Hello,
since some time a script is not working anymore, it is timing out. I could track down the problem to thingSpeakRead. I am reading some data to be visualized by this:
[loc_comp, timeStamps] = thingSpeakRead(readChannelID, ‘Field’, fieldID1, ‘ReadKey’, readAPIKey, DateRange=[(datetime – days(1)), datetime]);
It was working this way approx. until April and then I ignored it first. Now I’d like to use that visualization again but can’t it get it to work. If I replace the channel read by some fixed test data everything else is running as before. Just the channel read is not working …
channel id, field number and read key have not changed…
Any ideas? The Timeout=xx parameter did not help as well …
Thanks,
Jürgen
Edit:
i also tried e.g.
[loc_comp, timeStamps] = thingSpeakRead(123456, Fields=[6], ReadKey=’MySecretKey’, NumPoints=15, Timeout=60);
with the same timeout error appearing ..Hello,
since some time a script is not working anymore, it is timing out. I could track down the problem to thingSpeakRead. I am reading some data to be visualized by this:
[loc_comp, timeStamps] = thingSpeakRead(readChannelID, ‘Field’, fieldID1, ‘ReadKey’, readAPIKey, DateRange=[(datetime – days(1)), datetime]);
It was working this way approx. until April and then I ignored it first. Now I’d like to use that visualization again but can’t it get it to work. If I replace the channel read by some fixed test data everything else is running as before. Just the channel read is not working …
channel id, field number and read key have not changed…
Any ideas? The Timeout=xx parameter did not help as well …
Thanks,
Jürgen
Edit:
i also tried e.g.
[loc_comp, timeStamps] = thingSpeakRead(123456, Fields=[6], ReadKey=’MySecretKey’, NumPoints=15, Timeout=60);
with the same timeout error appearing .. Hello,
since some time a script is not working anymore, it is timing out. I could track down the problem to thingSpeakRead. I am reading some data to be visualized by this:
[loc_comp, timeStamps] = thingSpeakRead(readChannelID, ‘Field’, fieldID1, ‘ReadKey’, readAPIKey, DateRange=[(datetime – days(1)), datetime]);
It was working this way approx. until April and then I ignored it first. Now I’d like to use that visualization again but can’t it get it to work. If I replace the channel read by some fixed test data everything else is running as before. Just the channel read is not working …
channel id, field number and read key have not changed…
Any ideas? The Timeout=xx parameter did not help as well …
Thanks,
Jürgen
Edit:
i also tried e.g.
[loc_comp, timeStamps] = thingSpeakRead(123456, Fields=[6], ReadKey=’MySecretKey’, NumPoints=15, Timeout=60);
with the same timeout error appearing .. thingspeak, thingspeakread, timeout MATLAB Answers — New Questions
Mask R-CNN maximum number of detected instances per image.
Hi, I’ve been working on the mask r-cnn following the documentation instructions. I’ve got everything tot work but I stumbled upon a potential library mistake. Let me explain better my situation: I am working on a dataset with ~250 images (split between training and validation) and with just 1 category. Each image might have 40-50 instances up to 600-650 instances.
The problem is this, mask r-cnn can only detect up to 100 instances by class definition. I believe this is hurting the training of the network – however I cannot confirm this because I have to run the training by remote, by command prompt, since I don’t have a GPU powerful enough to run the training locally. My evidence is that the network, after the training, performs somewhat well on images with 40-50 instances, while it performs horrible on images with a lot of instances. In fact, when I evaluate my network on the validation set (something that I can do on my own computer), the network outputs at most 100 masks per image.
My "local" fix: I edited the maskrcnn.m file of the library. I went to the directory "C:ProgramFilesMATLABR2023btoolboxvisionvision@maskrcnnmaskrcnn.m" and at line 172 of the code, instead of
NumStrongestRegionsPrediction = 100
I put (expecting to not detect more than 800 instances, given my ground truth data)
NumStrongestRegionsPrediction = 800
which fixes my issue at least at validation time. However, since my training is run without this fix and, given my results, I am writing here to ask what I can do about this issue, I am basically certain my code is correct.
Again, all I can observe at training time is the training loss, which converges to a good number, however sometimes it outputs a bigger number, probably because it encounters the batch with the images with a lot of instances – in other words, the network isn’t learning enough out of these images and mistakes/training loss.
I can provide more information if needed, however for now I want to keep the post simple.Hi, I’ve been working on the mask r-cnn following the documentation instructions. I’ve got everything tot work but I stumbled upon a potential library mistake. Let me explain better my situation: I am working on a dataset with ~250 images (split between training and validation) and with just 1 category. Each image might have 40-50 instances up to 600-650 instances.
The problem is this, mask r-cnn can only detect up to 100 instances by class definition. I believe this is hurting the training of the network – however I cannot confirm this because I have to run the training by remote, by command prompt, since I don’t have a GPU powerful enough to run the training locally. My evidence is that the network, after the training, performs somewhat well on images with 40-50 instances, while it performs horrible on images with a lot of instances. In fact, when I evaluate my network on the validation set (something that I can do on my own computer), the network outputs at most 100 masks per image.
My "local" fix: I edited the maskrcnn.m file of the library. I went to the directory "C:ProgramFilesMATLABR2023btoolboxvisionvision@maskrcnnmaskrcnn.m" and at line 172 of the code, instead of
NumStrongestRegionsPrediction = 100
I put (expecting to not detect more than 800 instances, given my ground truth data)
NumStrongestRegionsPrediction = 800
which fixes my issue at least at validation time. However, since my training is run without this fix and, given my results, I am writing here to ask what I can do about this issue, I am basically certain my code is correct.
Again, all I can observe at training time is the training loss, which converges to a good number, however sometimes it outputs a bigger number, probably because it encounters the batch with the images with a lot of instances – in other words, the network isn’t learning enough out of these images and mistakes/training loss.
I can provide more information if needed, however for now I want to keep the post simple. Hi, I’ve been working on the mask r-cnn following the documentation instructions. I’ve got everything tot work but I stumbled upon a potential library mistake. Let me explain better my situation: I am working on a dataset with ~250 images (split between training and validation) and with just 1 category. Each image might have 40-50 instances up to 600-650 instances.
The problem is this, mask r-cnn can only detect up to 100 instances by class definition. I believe this is hurting the training of the network – however I cannot confirm this because I have to run the training by remote, by command prompt, since I don’t have a GPU powerful enough to run the training locally. My evidence is that the network, after the training, performs somewhat well on images with 40-50 instances, while it performs horrible on images with a lot of instances. In fact, when I evaluate my network on the validation set (something that I can do on my own computer), the network outputs at most 100 masks per image.
My "local" fix: I edited the maskrcnn.m file of the library. I went to the directory "C:ProgramFilesMATLABR2023btoolboxvisionvision@maskrcnnmaskrcnn.m" and at line 172 of the code, instead of
NumStrongestRegionsPrediction = 100
I put (expecting to not detect more than 800 instances, given my ground truth data)
NumStrongestRegionsPrediction = 800
which fixes my issue at least at validation time. However, since my training is run without this fix and, given my results, I am writing here to ask what I can do about this issue, I am basically certain my code is correct.
Again, all I can observe at training time is the training loss, which converges to a good number, however sometimes it outputs a bigger number, probably because it encounters the batch with the images with a lot of instances – in other words, the network isn’t learning enough out of these images and mistakes/training loss.
I can provide more information if needed, however for now I want to keep the post simple. deep learning, image segmentation, cnn MATLAB Answers — New Questions
Read and Display Dicom files from a folder as 3d
Hi all,
I was wondering how to read and display dicom files from a folder as a 3d image. The dicom slices are from a CT dataset. Any suggestions ?Hi all,
I was wondering how to read and display dicom files from a folder as a 3d image. The dicom slices are from a CT dataset. Any suggestions ? Hi all,
I was wondering how to read and display dicom files from a folder as a 3d image. The dicom slices are from a CT dataset. Any suggestions ? dicom, viewer, mat file, 3d MATLAB Answers — New Questions
changing dataset in SORT (simple online real-time tracking) example in Matlab
Hello. I want to use my dataset as input to the SORT example ( https://www.mathworks.com/help/fusion/ug/implement-simple-online-and-realtime-tracking.html ) in Matlab. I used the yolo4 object detection algorithm and set the input for the SORT algorithm. I attached my input data to the SORT example, which is in objectDetection format as it should be. when I run the SORT algorithm with my dataset, this error happens:
error using ()
changing the data type on input 3 of the system object trackerGNN is not allowed without first calling the release(.) method.
Error in helperRunSort (line 18)
tracks = tracker(highScoreDetections, reader.CurrentTime, iouCost);
I would appreciate it if anyone could help me solve this issue. Regards
whos -file objectDetectionsCell.matHello. I want to use my dataset as input to the SORT example ( https://www.mathworks.com/help/fusion/ug/implement-simple-online-and-realtime-tracking.html ) in Matlab. I used the yolo4 object detection algorithm and set the input for the SORT algorithm. I attached my input data to the SORT example, which is in objectDetection format as it should be. when I run the SORT algorithm with my dataset, this error happens:
error using ()
changing the data type on input 3 of the system object trackerGNN is not allowed without first calling the release(.) method.
Error in helperRunSort (line 18)
tracks = tracker(highScoreDetections, reader.CurrentTime, iouCost);
I would appreciate it if anyone could help me solve this issue. Regards
whos -file objectDetectionsCell.mat Hello. I want to use my dataset as input to the SORT example ( https://www.mathworks.com/help/fusion/ug/implement-simple-online-and-realtime-tracking.html ) in Matlab. I used the yolo4 object detection algorithm and set the input for the SORT algorithm. I attached my input data to the SORT example, which is in objectDetection format as it should be. when I run the SORT algorithm with my dataset, this error happens:
error using ()
changing the data type on input 3 of the system object trackerGNN is not allowed without first calling the release(.) method.
Error in helperRunSort (line 18)
tracks = tracker(highScoreDetections, reader.CurrentTime, iouCost);
I would appreciate it if anyone could help me solve this issue. Regards
whos -file objectDetectionsCell.mat object tracking, sort, simple online ral time tracking, error in matlab example MATLAB Answers — New Questions
How to calculate real roots of a polynomial equation under square root ?
syms t
coupler_parametric=[5163136522924301/2251799813685248,…
2^(1/2)/2 – (8*t)/(t^2 + 1), – (4*(t^2 – 1))/(t^2 + 1) – 2];
norm(coupler_parametric)
%upto this step ,i have calculated norm, if t can be any real number
%further i want to calculate real roots of equation given below,
eq= norm(coupler_parametric)-3.5;
%please help someone
%thanks!!syms t
coupler_parametric=[5163136522924301/2251799813685248,…
2^(1/2)/2 – (8*t)/(t^2 + 1), – (4*(t^2 – 1))/(t^2 + 1) – 2];
norm(coupler_parametric)
%upto this step ,i have calculated norm, if t can be any real number
%further i want to calculate real roots of equation given below,
eq= norm(coupler_parametric)-3.5;
%please help someone
%thanks!! syms t
coupler_parametric=[5163136522924301/2251799813685248,…
2^(1/2)/2 – (8*t)/(t^2 + 1), – (4*(t^2 – 1))/(t^2 + 1) – 2];
norm(coupler_parametric)
%upto this step ,i have calculated norm, if t can be any real number
%further i want to calculate real roots of equation given below,
eq= norm(coupler_parametric)-3.5;
%please help someone
%thanks!! #roots, #polynomial MATLAB Answers — New Questions
Problems to join Debian/Ubuntu machines to a domain
Is not posible to join Debian/Ubuntu machines to a domain based on Windows Server 2025 (using realm at least) this is the error:
! Couldn’t set password for computer account: XXXX$: Message stream modified
adcli: joining domain c2electronics.local failed: Couldn’t set password for computer account: XXXX$: Message stream modified
! Failed to join the domain
realm: Couldn’t join realm: Failed to join the domain
Domain is discoverable vía realm:
root@lnms01:/home/administrator# realm discover xxxx.local
xxxx.local
type: kerberos
realm-name: XXXX.LOCAL
domain-name: xxxx.local
configured: no
server-software: active-directory
client-software: sssd
required-package: sssd-tools
required-package: sssd
required-package: libnss-sss
Tested on WS2025 build 26227 and Linux 6.1.0-21-amd64 x86_64, Linux 6.6.31+rpt-rpi-v8 aarch64 and Linux 6.8.0-31-generic x86_64.
Those 3 versions of Linux joined to another doman based con Windows Server 2022 without issues.
Is not posible to join Debian/Ubuntu machines to a domain based on Windows Server 2025 (using realm at least) this is the error: ! Couldn’t set password for computer account: XXXX$: Message stream modifiedadcli: joining domain c2electronics.local failed: Couldn’t set password for computer account: XXXX$: Message stream modified! Failed to join the domainrealm: Couldn’t join realm: Failed to join the domain Domain is discoverable vía realm:root@lnms01:/home/administrator# realm discover xxxx.localxxxx.localtype: kerberosrealm-name: XXXX.LOCALdomain-name: xxxx.localconfigured: noserver-software: active-directoryclient-software: sssdrequired-package: sssd-toolsrequired-package: sssdrequired-package: libnss-sss Tested on WS2025 build 26227 and Linux 6.1.0-21-amd64 x86_64, Linux 6.6.31+rpt-rpi-v8 aarch64 and Linux 6.8.0-31-generic x86_64. Those 3 versions of Linux joined to another doman based con Windows Server 2022 without issues. Read More
Stop simulation block effect on aborting generated code execution.
Hello,
I have a SIMULINK model that contains a STOP SIMULATION block which is activated for a certian condition. When I generated the C code for this model by embedded coder and did a SIL, I noticed that the condition was not called in the execution and the code kept running until the simulation time even the condition was true.
The question is: is STOP SIMULATION block affect in the generated code ? I mean that is it generated like interrupt or something that stops the execution and return to the main function? Or it is just useful in the MIL ?Hello,
I have a SIMULINK model that contains a STOP SIMULATION block which is activated for a certian condition. When I generated the C code for this model by embedded coder and did a SIL, I noticed that the condition was not called in the execution and the code kept running until the simulation time even the condition was true.
The question is: is STOP SIMULATION block affect in the generated code ? I mean that is it generated like interrupt or something that stops the execution and return to the main function? Or it is just useful in the MIL ? Hello,
I have a SIMULINK model that contains a STOP SIMULATION block which is activated for a certian condition. When I generated the C code for this model by embedded coder and did a SIL, I noticed that the condition was not called in the execution and the code kept running until the simulation time even the condition was true.
The question is: is STOP SIMULATION block affect in the generated code ? I mean that is it generated like interrupt or something that stops the execution and return to the main function? Or it is just useful in the MIL ? simulink, matlab, embedded coder MATLAB Answers — New Questions
is it built in function or a structure ?
This is from the matalb documentation of reconfigurable intelligent surfaces. helperRISSurface is function or a structure ? how can i pass parameters?
i tried to rum this and i am getting error here. i have uploaded the screenshots
kindly help me
thank you.
=========================================================================
ris = helperRISSurface(‘Size’,[Nr Nc],’ElementSpacing’,[dr dc],…
‘ReflectorElement’,phased.IsotropicAntennaElement,’OperatingFrequency’,fc)
ris =
helperRISSurface with properties:
ReflectorElement: [1×1 phased.IsotropicAntennaElement]
Size: [10 20]
ElementSpacing: [0.0054 0.0054]
OperatingFrequency: 2.8000e+10
=====================================================================This is from the matalb documentation of reconfigurable intelligent surfaces. helperRISSurface is function or a structure ? how can i pass parameters?
i tried to rum this and i am getting error here. i have uploaded the screenshots
kindly help me
thank you.
=========================================================================
ris = helperRISSurface(‘Size’,[Nr Nc],’ElementSpacing’,[dr dc],…
‘ReflectorElement’,phased.IsotropicAntennaElement,’OperatingFrequency’,fc)
ris =
helperRISSurface with properties:
ReflectorElement: [1×1 phased.IsotropicAntennaElement]
Size: [10 20]
ElementSpacing: [0.0054 0.0054]
OperatingFrequency: 2.8000e+10
===================================================================== This is from the matalb documentation of reconfigurable intelligent surfaces. helperRISSurface is function or a structure ? how can i pass parameters?
i tried to rum this and i am getting error here. i have uploaded the screenshots
kindly help me
thank you.
=========================================================================
ris = helperRISSurface(‘Size’,[Nr Nc],’ElementSpacing’,[dr dc],…
‘ReflectorElement’,phased.IsotropicAntennaElement,’OperatingFrequency’,fc)
ris =
helperRISSurface with properties:
ReflectorElement: [1×1 phased.IsotropicAntennaElement]
Size: [10 20]
ElementSpacing: [0.0054 0.0054]
OperatingFrequency: 2.8000e+10
===================================================================== coding in matlab MATLAB Answers — New Questions
objectDetection (Report for single object detection) and YOLO.
Hello everyone!
I need some help with using the Object Detection function in YOLO to obtain detection results based on frames. I’ve tried various codes, but the results are not what I expect. Any advice or guidance would be greatly appreciated.
for example
Video = VideoReader("tr.avi",CurrentTime=0);
player = vision.VideoPlayer;
detections = {};
measurementNoise = 10;
while hasFrame(Video)
frame = readFrame(Video);
frameIndex = round(Video.CurrentTime * Video.FrameRate);
[bbox, score, label] = detect(detector, frame);
if length(detections) < frameIndex
detections{frameIndex} = {};
end
for i = 1:length(score)
detections{frameIndex}{end+1} = objectDetection(frameIndex, bbox(i,:), …
"MeasurementNoise", measurementNoise, "ObjectAttributes", struct("Score", score(i)));
end
Object = insertObjectAnnotation(frame, "rectangle", bbox, label, "Color", "green");
step(player, Object);
end
Thank you!Hello everyone!
I need some help with using the Object Detection function in YOLO to obtain detection results based on frames. I’ve tried various codes, but the results are not what I expect. Any advice or guidance would be greatly appreciated.
for example
Video = VideoReader("tr.avi",CurrentTime=0);
player = vision.VideoPlayer;
detections = {};
measurementNoise = 10;
while hasFrame(Video)
frame = readFrame(Video);
frameIndex = round(Video.CurrentTime * Video.FrameRate);
[bbox, score, label] = detect(detector, frame);
if length(detections) < frameIndex
detections{frameIndex} = {};
end
for i = 1:length(score)
detections{frameIndex}{end+1} = objectDetection(frameIndex, bbox(i,:), …
"MeasurementNoise", measurementNoise, "ObjectAttributes", struct("Score", score(i)));
end
Object = insertObjectAnnotation(frame, "rectangle", bbox, label, "Color", "green");
step(player, Object);
end
Thank you! Hello everyone!
I need some help with using the Object Detection function in YOLO to obtain detection results based on frames. I’ve tried various codes, but the results are not what I expect. Any advice or guidance would be greatly appreciated.
for example
Video = VideoReader("tr.avi",CurrentTime=0);
player = vision.VideoPlayer;
detections = {};
measurementNoise = 10;
while hasFrame(Video)
frame = readFrame(Video);
frameIndex = round(Video.CurrentTime * Video.FrameRate);
[bbox, score, label] = detect(detector, frame);
if length(detections) < frameIndex
detections{frameIndex} = {};
end
for i = 1:length(score)
detections{frameIndex}{end+1} = objectDetection(frameIndex, bbox(i,:), …
"MeasurementNoise", measurementNoise, "ObjectAttributes", struct("Score", score(i)));
end
Object = insertObjectAnnotation(frame, "rectangle", bbox, label, "Color", "green");
step(player, Object);
end
Thank you! objectdetection MATLAB Answers — New Questions