Category: Matlab
Category Archives: Matlab
In a table, when I try assigning a value to a new column based on some criteria, I get error that “assignment to elements using simple assignment statement is not supported”
I have a table for which I create an index where the values in a particular column are not NaN. I then try to use this index to create an entry into a new array and replace the values at the corresponding index (preloaded with ‘0000’) with ‘0001’. I will then add this array to the table as a new column.
My intention is to fill the corresponding indx in the column with ‘0001’, if the value in the newTable.PEM1_GA_Current_Estimate_Error a valid number (not NaN).
PEM1b =’0001′;
PEM2b =’0010′;
PEM3b = ‘0100’;
PEM4 = ‘1000’;
temp={};
indx=(find(newTable.PEM1_GA_Current_Estimate_Error ~= NaN))
temp ={repmat(‘0000’,size(newTable,1),1)}
temp{indx} = PEM1b
%…and add this array as a new column to the table
the last assigment in the code above generates this error:
Assigning to 2609 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment.
I don’t think I should need a for loop to iterate through each row and replace the value at the "indx" location –what am I doing wrong?
I included the data….thank you.I have a table for which I create an index where the values in a particular column are not NaN. I then try to use this index to create an entry into a new array and replace the values at the corresponding index (preloaded with ‘0000’) with ‘0001’. I will then add this array to the table as a new column.
My intention is to fill the corresponding indx in the column with ‘0001’, if the value in the newTable.PEM1_GA_Current_Estimate_Error a valid number (not NaN).
PEM1b =’0001′;
PEM2b =’0010′;
PEM3b = ‘0100’;
PEM4 = ‘1000’;
temp={};
indx=(find(newTable.PEM1_GA_Current_Estimate_Error ~= NaN))
temp ={repmat(‘0000’,size(newTable,1),1)}
temp{indx} = PEM1b
%…and add this array as a new column to the table
the last assigment in the code above generates this error:
Assigning to 2609 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment.
I don’t think I should need a for loop to iterate through each row and replace the value at the "indx" location –what am I doing wrong?
I included the data….thank you. I have a table for which I create an index where the values in a particular column are not NaN. I then try to use this index to create an entry into a new array and replace the values at the corresponding index (preloaded with ‘0000’) with ‘0001’. I will then add this array to the table as a new column.
My intention is to fill the corresponding indx in the column with ‘0001’, if the value in the newTable.PEM1_GA_Current_Estimate_Error a valid number (not NaN).
PEM1b =’0001′;
PEM2b =’0010′;
PEM3b = ‘0100’;
PEM4 = ‘1000’;
temp={};
indx=(find(newTable.PEM1_GA_Current_Estimate_Error ~= NaN))
temp ={repmat(‘0000’,size(newTable,1),1)}
temp{indx} = PEM1b
%…and add this array as a new column to the table
the last assigment in the code above generates this error:
Assigning to 2609 elements using a simple assignment statement is not supported. Consider using comma-separated list assignment.
I don’t think I should need a for loop to iterate through each row and replace the value at the "indx" location –what am I doing wrong?
I included the data….thank you. cell array, indexing MATLAB Answers — New Questions
i get black image danoise when the simulation finish what is the problem in the code ?
clc
clear all
close all
image_org=imread(‘C:UserspcOneDriveDesktopmemoirechapitre 3image for test’,’JPG’);
% Gaussian white noise
X = double(image_org) / 255;
NG = imnoise(X, ‘gaussian’, 0, 0.01);%NG=gaussian noise
figure(1);subplot(231); imshow(image_org);title (‘image org’)
subplot(233); imshow(NG) ; title (‘Gaussian additive noise’)
NG_gray = rgb2gray(NG);
%averaging filter
f_m = fspecial (‘average’, 3)%f_m=averaging filter
NGmoy = imfilter (NG, f_m,’replicate’);
%gaussian filter
f_g = fspecial (‘gaussian’,3,0.8)%f_g=gaussian filter
NGg = imfilter(NG,f_g,’replicate’);
%median filter
NGmed = medfilt2( NG_gray ,[3 3]);
%the show
subplot(234); imshow(NGmoy);title(‘ avraging Filter ‘)
subplot(235); imshow(NGg);title(‘ gaussien Filtre ‘)
subplot(236); imshow(NGmed);title(‘ median Filtre’)
%PSNR
EQMb=mean2((X-NG).^2 );PSNRb=-10*log10(EQMb);
EQMmoy=mean2( (NG-NGmoy).^2 );PSNRmoy=-10*log10(EQMmoy);
EQMg=mean2( (NG-NGg).^2 );PSNRg=-10*log10(EQMg);
EQMmed=mean2( (NG_gray-NGmed).^2 );PSNRmed=-10*log10(EQMmed);
% Resize the original image to match the input size of the CNN
image_resized = imresize(image_org, [299 450]);
% Add Gaussian noise to the original image
X = double(image_resized) / 255;
NG = imnoise(X, ‘gaussian’, 0, 0.03); % Add Gaussian noise
% Display the original and noisy images
figure(1);
subplot(1, 2, 1);
imshow(image_resized);
title(‘Original Image’);
subplot(1, 2, 2);
imshow(NG);
title(‘Noisy Image’);
% Prepare data for training (noisy images as input, original images as target)
inputData = NG; % Noisy images
targetData = X; % Original clean images
% Define the CNN architecture for image denoising
layers = [
imageInputLayer([299 450 3]) % Input layer with the size of the input images
convolution2dLayer(3, 64, ‘Padding’, ‘same’) % Convolutional layer with 64 filters of size 3×3
reluLayer % ReLU activation layer
convolution2dLayer(3, 64, ‘Padding’, ‘same’) % Another convolutional layer
reluLayer % ReLU activation layer
convolution2dLayer(3, 3, ‘Padding’, ‘same’) % Output convolutional layer with 3 channels (RGB)
regressionLayer % Regression layer
];
% Define training options
options = trainingOptions(‘adam’, … % Adam optimizer
‘MaxEpochs’, 50, … % Increase the number of epochs
‘MiniBatchSize’, 16, … % Decrease the mini-batch size
‘InitialLearnRate’, 1e-4, … % Decrease the initial learning rate
‘Plots’, ‘training-progress’); % Plot training progress
% Train the network
net = trainNetwork(inputData, targetData, layers, options);
% Denoise the image using the trained CNN
denoisedImage = predict(net, inputData);
% Display the original noisy image and the denoised image
figure;
subplot(1, 2, 1);
imshow(inputData);
title(‘Noisy Image’);
subplot(1, 2, 2);
imshow(denoisedImage);
title(‘Denoised Image’);clc
clear all
close all
image_org=imread(‘C:UserspcOneDriveDesktopmemoirechapitre 3image for test’,’JPG’);
% Gaussian white noise
X = double(image_org) / 255;
NG = imnoise(X, ‘gaussian’, 0, 0.01);%NG=gaussian noise
figure(1);subplot(231); imshow(image_org);title (‘image org’)
subplot(233); imshow(NG) ; title (‘Gaussian additive noise’)
NG_gray = rgb2gray(NG);
%averaging filter
f_m = fspecial (‘average’, 3)%f_m=averaging filter
NGmoy = imfilter (NG, f_m,’replicate’);
%gaussian filter
f_g = fspecial (‘gaussian’,3,0.8)%f_g=gaussian filter
NGg = imfilter(NG,f_g,’replicate’);
%median filter
NGmed = medfilt2( NG_gray ,[3 3]);
%the show
subplot(234); imshow(NGmoy);title(‘ avraging Filter ‘)
subplot(235); imshow(NGg);title(‘ gaussien Filtre ‘)
subplot(236); imshow(NGmed);title(‘ median Filtre’)
%PSNR
EQMb=mean2((X-NG).^2 );PSNRb=-10*log10(EQMb);
EQMmoy=mean2( (NG-NGmoy).^2 );PSNRmoy=-10*log10(EQMmoy);
EQMg=mean2( (NG-NGg).^2 );PSNRg=-10*log10(EQMg);
EQMmed=mean2( (NG_gray-NGmed).^2 );PSNRmed=-10*log10(EQMmed);
% Resize the original image to match the input size of the CNN
image_resized = imresize(image_org, [299 450]);
% Add Gaussian noise to the original image
X = double(image_resized) / 255;
NG = imnoise(X, ‘gaussian’, 0, 0.03); % Add Gaussian noise
% Display the original and noisy images
figure(1);
subplot(1, 2, 1);
imshow(image_resized);
title(‘Original Image’);
subplot(1, 2, 2);
imshow(NG);
title(‘Noisy Image’);
% Prepare data for training (noisy images as input, original images as target)
inputData = NG; % Noisy images
targetData = X; % Original clean images
% Define the CNN architecture for image denoising
layers = [
imageInputLayer([299 450 3]) % Input layer with the size of the input images
convolution2dLayer(3, 64, ‘Padding’, ‘same’) % Convolutional layer with 64 filters of size 3×3
reluLayer % ReLU activation layer
convolution2dLayer(3, 64, ‘Padding’, ‘same’) % Another convolutional layer
reluLayer % ReLU activation layer
convolution2dLayer(3, 3, ‘Padding’, ‘same’) % Output convolutional layer with 3 channels (RGB)
regressionLayer % Regression layer
];
% Define training options
options = trainingOptions(‘adam’, … % Adam optimizer
‘MaxEpochs’, 50, … % Increase the number of epochs
‘MiniBatchSize’, 16, … % Decrease the mini-batch size
‘InitialLearnRate’, 1e-4, … % Decrease the initial learning rate
‘Plots’, ‘training-progress’); % Plot training progress
% Train the network
net = trainNetwork(inputData, targetData, layers, options);
% Denoise the image using the trained CNN
denoisedImage = predict(net, inputData);
% Display the original noisy image and the denoised image
figure;
subplot(1, 2, 1);
imshow(inputData);
title(‘Noisy Image’);
subplot(1, 2, 2);
imshow(denoisedImage);
title(‘Denoised Image’); clc
clear all
close all
image_org=imread(‘C:UserspcOneDriveDesktopmemoirechapitre 3image for test’,’JPG’);
% Gaussian white noise
X = double(image_org) / 255;
NG = imnoise(X, ‘gaussian’, 0, 0.01);%NG=gaussian noise
figure(1);subplot(231); imshow(image_org);title (‘image org’)
subplot(233); imshow(NG) ; title (‘Gaussian additive noise’)
NG_gray = rgb2gray(NG);
%averaging filter
f_m = fspecial (‘average’, 3)%f_m=averaging filter
NGmoy = imfilter (NG, f_m,’replicate’);
%gaussian filter
f_g = fspecial (‘gaussian’,3,0.8)%f_g=gaussian filter
NGg = imfilter(NG,f_g,’replicate’);
%median filter
NGmed = medfilt2( NG_gray ,[3 3]);
%the show
subplot(234); imshow(NGmoy);title(‘ avraging Filter ‘)
subplot(235); imshow(NGg);title(‘ gaussien Filtre ‘)
subplot(236); imshow(NGmed);title(‘ median Filtre’)
%PSNR
EQMb=mean2((X-NG).^2 );PSNRb=-10*log10(EQMb);
EQMmoy=mean2( (NG-NGmoy).^2 );PSNRmoy=-10*log10(EQMmoy);
EQMg=mean2( (NG-NGg).^2 );PSNRg=-10*log10(EQMg);
EQMmed=mean2( (NG_gray-NGmed).^2 );PSNRmed=-10*log10(EQMmed);
% Resize the original image to match the input size of the CNN
image_resized = imresize(image_org, [299 450]);
% Add Gaussian noise to the original image
X = double(image_resized) / 255;
NG = imnoise(X, ‘gaussian’, 0, 0.03); % Add Gaussian noise
% Display the original and noisy images
figure(1);
subplot(1, 2, 1);
imshow(image_resized);
title(‘Original Image’);
subplot(1, 2, 2);
imshow(NG);
title(‘Noisy Image’);
% Prepare data for training (noisy images as input, original images as target)
inputData = NG; % Noisy images
targetData = X; % Original clean images
% Define the CNN architecture for image denoising
layers = [
imageInputLayer([299 450 3]) % Input layer with the size of the input images
convolution2dLayer(3, 64, ‘Padding’, ‘same’) % Convolutional layer with 64 filters of size 3×3
reluLayer % ReLU activation layer
convolution2dLayer(3, 64, ‘Padding’, ‘same’) % Another convolutional layer
reluLayer % ReLU activation layer
convolution2dLayer(3, 3, ‘Padding’, ‘same’) % Output convolutional layer with 3 channels (RGB)
regressionLayer % Regression layer
];
% Define training options
options = trainingOptions(‘adam’, … % Adam optimizer
‘MaxEpochs’, 50, … % Increase the number of epochs
‘MiniBatchSize’, 16, … % Decrease the mini-batch size
‘InitialLearnRate’, 1e-4, … % Decrease the initial learning rate
‘Plots’, ‘training-progress’); % Plot training progress
% Train the network
net = trainNetwork(inputData, targetData, layers, options);
% Denoise the image using the trained CNN
denoisedImage = predict(net, inputData);
% Display the original noisy image and the denoised image
figure;
subplot(1, 2, 1);
imshow(inputData);
title(‘Noisy Image’);
subplot(1, 2, 2);
imshow(denoisedImage);
title(‘Denoised Image’); deep learning, neural network MATLAB Answers — New Questions
Combining text with non-zero elements of a 2D array
I have a numerical array that is "almost" diagonal, so it looks like this:
N=[10 0 0 0 0; 0 20 0 0 0; 10 0 20 0 0; 0 0 0 10 0; 0 0 0 0 30]
I also have a cell array with the same number of rows, which looks like this:
C={‘ABC’;’DEF’;’GHI’;’JKL’;’MNO’}
I would like to create a row array that takes the non-zero values of N, and combines them with the text in C to give an output like this:
CN={‘ABC10_GHI10’ ‘DEF20’ ‘GHI10’ ‘JKL10’ ‘MNO30’}
In other words, it must combine all the non-zero values of each column with text of respective indices.I have a numerical array that is "almost" diagonal, so it looks like this:
N=[10 0 0 0 0; 0 20 0 0 0; 10 0 20 0 0; 0 0 0 10 0; 0 0 0 0 30]
I also have a cell array with the same number of rows, which looks like this:
C={‘ABC’;’DEF’;’GHI’;’JKL’;’MNO’}
I would like to create a row array that takes the non-zero values of N, and combines them with the text in C to give an output like this:
CN={‘ABC10_GHI10’ ‘DEF20’ ‘GHI10’ ‘JKL10’ ‘MNO30’}
In other words, it must combine all the non-zero values of each column with text of respective indices. I have a numerical array that is "almost" diagonal, so it looks like this:
N=[10 0 0 0 0; 0 20 0 0 0; 10 0 20 0 0; 0 0 0 10 0; 0 0 0 0 30]
I also have a cell array with the same number of rows, which looks like this:
C={‘ABC’;’DEF’;’GHI’;’JKL’;’MNO’}
I would like to create a row array that takes the non-zero values of N, and combines them with the text in C to give an output like this:
CN={‘ABC10_GHI10’ ‘DEF20’ ‘GHI10’ ‘JKL10’ ‘MNO30’}
In other words, it must combine all the non-zero values of each column with text of respective indices. cell arrays, combining text and numericals, non-zero element, find MATLAB Answers — New Questions
How to use PID controller
I have a control loop such that:
The loop starts by calculating the error between the desired and measured temperature.
The relay block turns the heating system on or off based on this error, with a hysteresis of ±5 degrees to prevent frequent switching.
The output from the relay (on/off signal) is passed through a transfer function to simulate the dynamics of the system (introducing a delay or lag in the heating response).
The scaled output from the transfer function (now a power signal) is converted into a physical signal.
Finally, the physical signal controls the heat source, which in turn affects the system’s temperature.
I want to use PID controller block instead of this, how can I achieve that?I have a control loop such that:
The loop starts by calculating the error between the desired and measured temperature.
The relay block turns the heating system on or off based on this error, with a hysteresis of ±5 degrees to prevent frequent switching.
The output from the relay (on/off signal) is passed through a transfer function to simulate the dynamics of the system (introducing a delay or lag in the heating response).
The scaled output from the transfer function (now a power signal) is converted into a physical signal.
Finally, the physical signal controls the heat source, which in turn affects the system’s temperature.
I want to use PID controller block instead of this, how can I achieve that? I have a control loop such that:
The loop starts by calculating the error between the desired and measured temperature.
The relay block turns the heating system on or off based on this error, with a hysteresis of ±5 degrees to prevent frequent switching.
The output from the relay (on/off signal) is passed through a transfer function to simulate the dynamics of the system (introducing a delay or lag in the heating response).
The scaled output from the transfer function (now a power signal) is converted into a physical signal.
Finally, the physical signal controls the heat source, which in turn affects the system’s temperature.
I want to use PID controller block instead of this, how can I achieve that? simulink, pid, simscape MATLAB Answers — New Questions
Variable gets cleared after each simulation step with simulink
Hello all,
I am using a System Object (SO) in combination with Simulink to simulate some stuff. Within that SO multiple objects of normal Matlab classes are instantiated in the setupImpl method. From one stepImpl to the next it seems that Matlab/Simulink clears/re-initializes the properties of those Matlab objects which in return costs time. How can I prevent this from happening? I want the memory of the Matlab Objects to be untouched because the size of their properties is large and don’t change over time. I thought of using persistent variables but I fail in defining persistent properties. Is that possible and if so, how?
Any hint is highly appreciated!Hello all,
I am using a System Object (SO) in combination with Simulink to simulate some stuff. Within that SO multiple objects of normal Matlab classes are instantiated in the setupImpl method. From one stepImpl to the next it seems that Matlab/Simulink clears/re-initializes the properties of those Matlab objects which in return costs time. How can I prevent this from happening? I want the memory of the Matlab Objects to be untouched because the size of their properties is large and don’t change over time. I thought of using persistent variables but I fail in defining persistent properties. Is that possible and if so, how?
Any hint is highly appreciated! Hello all,
I am using a System Object (SO) in combination with Simulink to simulate some stuff. Within that SO multiple objects of normal Matlab classes are instantiated in the setupImpl method. From one stepImpl to the next it seems that Matlab/Simulink clears/re-initializes the properties of those Matlab objects which in return costs time. How can I prevent this from happening? I want the memory of the Matlab Objects to be untouched because the size of their properties is large and don’t change over time. I thought of using persistent variables but I fail in defining persistent properties. Is that possible and if so, how?
Any hint is highly appreciated! persistent memory, simulink, class MATLAB Answers — New Questions
How to Measure Power Consumption of a Multiplexer and XOR Gate in MATLAB Simulink?
Hello everyone,
I am currently working on a logic circuit in MATLAB Simulink that involves a Multiplexer (MUX) and an XOR gate. I would like to measure the power consumption (current) of both the MUX and XOR components, but I’m not sure how to go about it in Simulink.
Here are some details about my setup:
I have a 4-to-1 MUX and an XOR gate in my design.
I am looking to measure the dynamic power consumption for each gate during operation.
Could anyone provide guidance on:
How to model or simulate the power consumption for logic components like MUX and XOR gates in Simulink?
Any recommended blocks or libraries to use?
Approaches for accurately measuring the current drawn by these components?
Any tips or examples would be greatly appreciated!Hello everyone,
I am currently working on a logic circuit in MATLAB Simulink that involves a Multiplexer (MUX) and an XOR gate. I would like to measure the power consumption (current) of both the MUX and XOR components, but I’m not sure how to go about it in Simulink.
Here are some details about my setup:
I have a 4-to-1 MUX and an XOR gate in my design.
I am looking to measure the dynamic power consumption for each gate during operation.
Could anyone provide guidance on:
How to model or simulate the power consumption for logic components like MUX and XOR gates in Simulink?
Any recommended blocks or libraries to use?
Approaches for accurately measuring the current drawn by these components?
Any tips or examples would be greatly appreciated! Hello everyone,
I am currently working on a logic circuit in MATLAB Simulink that involves a Multiplexer (MUX) and an XOR gate. I would like to measure the power consumption (current) of both the MUX and XOR components, but I’m not sure how to go about it in Simulink.
Here are some details about my setup:
I have a 4-to-1 MUX and an XOR gate in my design.
I am looking to measure the dynamic power consumption for each gate during operation.
Could anyone provide guidance on:
How to model or simulate the power consumption for logic components like MUX and XOR gates in Simulink?
Any recommended blocks or libraries to use?
Approaches for accurately measuring the current drawn by these components?
Any tips or examples would be greatly appreciated! simulink, mux, xor, current-power MATLAB Answers — New Questions
Need to show solutions (x) per iteration
I am using this optimizer tool since Matlab obliterated the old one —->
It has all these options, shown in the image bellow, to display many different values per iteration, except an option to display each value of the solution, x, at each iteration – which is what I need.
I have noticed that a lot of people have already asked the same question, but all the answers don’t seem to apply to the code I’m using (generated by the new optimization tool). While answers related to the old tool box do not apply anymore. The code the new tool generates looks a bit like this:
% Pass fixed parameters to objfun
objfun19 = @(x)LDR(x);
% Set nondefault solver options
options20 = optimoptions("gamultiobj","ConstraintTolerance",1e-05,"Display",…
"iter");
% Solve
[solution0,objectiveValue0] = gamultiobj(objfun19,v0,[],[],[],[],min,max,[],[],…
options20);
Where x is an array. I have been using multi-objective genetic algorithm, pareto search, and fmincon, which all look almost the same.
Appreciate any help. Please and thank you.I am using this optimizer tool since Matlab obliterated the old one —->
It has all these options, shown in the image bellow, to display many different values per iteration, except an option to display each value of the solution, x, at each iteration – which is what I need.
I have noticed that a lot of people have already asked the same question, but all the answers don’t seem to apply to the code I’m using (generated by the new optimization tool). While answers related to the old tool box do not apply anymore. The code the new tool generates looks a bit like this:
% Pass fixed parameters to objfun
objfun19 = @(x)LDR(x);
% Set nondefault solver options
options20 = optimoptions("gamultiobj","ConstraintTolerance",1e-05,"Display",…
"iter");
% Solve
[solution0,objectiveValue0] = gamultiobj(objfun19,v0,[],[],[],[],min,max,[],[],…
options20);
Where x is an array. I have been using multi-objective genetic algorithm, pareto search, and fmincon, which all look almost the same.
Appreciate any help. Please and thank you. I am using this optimizer tool since Matlab obliterated the old one —->
It has all these options, shown in the image bellow, to display many different values per iteration, except an option to display each value of the solution, x, at each iteration – which is what I need.
I have noticed that a lot of people have already asked the same question, but all the answers don’t seem to apply to the code I’m using (generated by the new optimization tool). While answers related to the old tool box do not apply anymore. The code the new tool generates looks a bit like this:
% Pass fixed parameters to objfun
objfun19 = @(x)LDR(x);
% Set nondefault solver options
options20 = optimoptions("gamultiobj","ConstraintTolerance",1e-05,"Display",…
"iter");
% Solve
[solution0,objectiveValue0] = gamultiobj(objfun19,v0,[],[],[],[],min,max,[],[],…
options20);
Where x is an array. I have been using multi-objective genetic algorithm, pareto search, and fmincon, which all look almost the same.
Appreciate any help. Please and thank you. optimization MATLAB Answers — New Questions
ERROR: ld.so: object ‘/tools/matlab/R2023bU1/bin/glnxa64/glibc-2.17_shim.so’ from LD_PRELOAD cannot be preloaded: ignored.
I experience this error when using HDL Verifier on a Linux machine (RedHat 7)
ERROR: ld.so: object ‘/tools/matlab/R2023bU1/bin/glnxa64/glibc-2.17_shim.so’ from LD_PRELOAD cannot be preloaded: ignored.
Do you know how I can overcome this issue?I experience this error when using HDL Verifier on a Linux machine (RedHat 7)
ERROR: ld.so: object ‘/tools/matlab/R2023bU1/bin/glnxa64/glibc-2.17_shim.so’ from LD_PRELOAD cannot be preloaded: ignored.
Do you know how I can overcome this issue? I experience this error when using HDL Verifier on a Linux machine (RedHat 7)
ERROR: ld.so: object ‘/tools/matlab/R2023bU1/bin/glnxa64/glibc-2.17_shim.so’ from LD_PRELOAD cannot be preloaded: ignored.
Do you know how I can overcome this issue? hdlverifier, simulink, linux, redhat MATLAB Answers — New Questions
How to determine the surrounding vertices of a particular node/voronoi cell ?
I want to determine the surrounding(corresponding) vertices of all the nodes of the voronoi cells. Please help adding to the program below.
x=[2 2 3 3 4 5 5 5 6 7 8];
y=[1 3 1 3 4 4 5 6 5 4 2];
N=[x’ y’];
axis([0 10 0 10]);
hold on;
scatter(x,y, [], ‘filled’);
%Labelling the nodes
labels = cellstr( num2str([1:length(x)]’) );
plot(N(:,1), N(:,2), ‘bx’)
text(N(:,1), N(:,2), labels, ‘VerticalAlignment’,’bottom’, …
‘HorizontalAlignment’,’right’)
%Voronoi
voronoi(x,y,’green’);
[vx,vy]=voronoi(x,y);
plot(vx,vy,’rx’);
grid on
[V C]=voronoin(N); %
%Labelling the vertices
labels = cellstr( num2str([1:length(V)]’) );
plot(V(:,1), V(:,2), ‘rx’)
text(V(:,1), V(:,2), labels, ‘VerticalAlignment’,’bottom’, …
‘HorizontalAlignment’,’right’)I want to determine the surrounding(corresponding) vertices of all the nodes of the voronoi cells. Please help adding to the program below.
x=[2 2 3 3 4 5 5 5 6 7 8];
y=[1 3 1 3 4 4 5 6 5 4 2];
N=[x’ y’];
axis([0 10 0 10]);
hold on;
scatter(x,y, [], ‘filled’);
%Labelling the nodes
labels = cellstr( num2str([1:length(x)]’) );
plot(N(:,1), N(:,2), ‘bx’)
text(N(:,1), N(:,2), labels, ‘VerticalAlignment’,’bottom’, …
‘HorizontalAlignment’,’right’)
%Voronoi
voronoi(x,y,’green’);
[vx,vy]=voronoi(x,y);
plot(vx,vy,’rx’);
grid on
[V C]=voronoin(N); %
%Labelling the vertices
labels = cellstr( num2str([1:length(V)]’) );
plot(V(:,1), V(:,2), ‘rx’)
text(V(:,1), V(:,2), labels, ‘VerticalAlignment’,’bottom’, …
‘HorizontalAlignment’,’right’) I want to determine the surrounding(corresponding) vertices of all the nodes of the voronoi cells. Please help adding to the program below.
x=[2 2 3 3 4 5 5 5 6 7 8];
y=[1 3 1 3 4 4 5 6 5 4 2];
N=[x’ y’];
axis([0 10 0 10]);
hold on;
scatter(x,y, [], ‘filled’);
%Labelling the nodes
labels = cellstr( num2str([1:length(x)]’) );
plot(N(:,1), N(:,2), ‘bx’)
text(N(:,1), N(:,2), labels, ‘VerticalAlignment’,’bottom’, …
‘HorizontalAlignment’,’right’)
%Voronoi
voronoi(x,y,’green’);
[vx,vy]=voronoi(x,y);
plot(vx,vy,’rx’);
grid on
[V C]=voronoin(N); %
%Labelling the vertices
labels = cellstr( num2str([1:length(V)]’) );
plot(V(:,1), V(:,2), ‘rx’)
text(V(:,1), V(:,2), labels, ‘VerticalAlignment’,’bottom’, …
‘HorizontalAlignment’,’right’) aida MATLAB Answers — New Questions
I need a program with a triangular Bezier patch in matlab
I need a program with a triangular Bezier patch in matlabI need a program with a triangular Bezier patch in matlab I need a program with a triangular Bezier patch in matlab bezier -patch -triangular-surf MATLAB Answers — New Questions
TI C2000 Microcontroller Slow IPC-Transmission of an int32 with just 1kHz
I tried to send an int32 via IPC transmit from the C28x CPU to the ARM M4-Cortex every 100 microseconds (10kHz clock-frequency) by using an EPWM-block and an EPWM-Hardware-Interrupt. Unfortunately, the IPC transmission only works fine until clock-frequencies of 1kHz (every 1 milliseconds). For higher clock-frequencys, the IPC-tranmission shuts down. Even by using the IPC-Receive on polling instead of using an IPC-Hardware-Interrupt, frequencies higher than 1kHz cannot be reached. In my understanding, the transmission should only be limited by the reading&writing speed of the Message-RAM (which must be at least 1MHz for an int32).
Could somebody assist how to increase the performance of the IPC transmission? Thanks in advance!
Kind regards!I tried to send an int32 via IPC transmit from the C28x CPU to the ARM M4-Cortex every 100 microseconds (10kHz clock-frequency) by using an EPWM-block and an EPWM-Hardware-Interrupt. Unfortunately, the IPC transmission only works fine until clock-frequencies of 1kHz (every 1 milliseconds). For higher clock-frequencys, the IPC-tranmission shuts down. Even by using the IPC-Receive on polling instead of using an IPC-Hardware-Interrupt, frequencies higher than 1kHz cannot be reached. In my understanding, the transmission should only be limited by the reading&writing speed of the Message-RAM (which must be at least 1MHz for an int32).
Could somebody assist how to increase the performance of the IPC transmission? Thanks in advance!
Kind regards! I tried to send an int32 via IPC transmit from the C28x CPU to the ARM M4-Cortex every 100 microseconds (10kHz clock-frequency) by using an EPWM-block and an EPWM-Hardware-Interrupt. Unfortunately, the IPC transmission only works fine until clock-frequencies of 1kHz (every 1 milliseconds). For higher clock-frequencys, the IPC-tranmission shuts down. Even by using the IPC-Receive on polling instead of using an IPC-Hardware-Interrupt, frequencies higher than 1kHz cannot be reached. In my understanding, the transmission should only be limited by the reading&writing speed of the Message-RAM (which must be at least 1MHz for an int32).
Could somebody assist how to increase the performance of the IPC transmission? Thanks in advance!
Kind regards! c2000, ipc, ipc-transmit, ipc-receive MATLAB Answers — New Questions
How do I resolve this error “Can’t load C:ProgramFilesMATLAB2024abinwin64l……: while trying to load SIMULINK
Hello, while attempting to use SIMULINK in MATLAB 2024a for my training, the above message was seen. Any help?Hello, while attempting to use SIMULINK in MATLAB 2024a for my training, the above message was seen. Any help? Hello, while attempting to use SIMULINK in MATLAB 2024a for my training, the above message was seen. Any help? simulink, matlab MATLAB Answers — New Questions
How to extract pixel intensity of a grayscale image (*.jpg) to a MS Excel table
Hello everyone, I am a very new beginner with image processing and Mathlab. Please help me with the following isse, many thanks in advance !
I have a grayscale image. I’d like to extract its pixel intensities to a MS Excel table with three vectors, including pixel intensiy, X and Y coordinates of the pixel.Hello everyone, I am a very new beginner with image processing and Mathlab. Please help me with the following isse, many thanks in advance !
I have a grayscale image. I’d like to extract its pixel intensities to a MS Excel table with three vectors, including pixel intensiy, X and Y coordinates of the pixel. Hello everyone, I am a very new beginner with image processing and Mathlab. Please help me with the following isse, many thanks in advance !
I have a grayscale image. I’d like to extract its pixel intensities to a MS Excel table with three vectors, including pixel intensiy, X and Y coordinates of the pixel. digital image processing, mathematics MATLAB Answers — New Questions
creating multiple holes in a flatwire PDE Modeler
Hi,
Matlab suggested me to create a more efficient code: what i am trying to do is to create 12 holes vertically in a strip of wire and repeat it 7x times over a 0.2 distance: i started with this code:
model = createpde;
%Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
rectx=0;
recty=0;
rect_width=1.38;
rect_height=0.2;
x_start=0.1;%starting position x circle
y_start=0.2;%starting position y circle
radius=0.005;%radius holes
num_holes_y=12;%number of repitition in the y
num_rep_x=7;%number of repitition in the x
y_interval=0.0183; %distance between the holes in the y;
x_interval=0.2; % distance between the holes in the x;
pderect([rectx rect_width recty,rect_height] )
%create multiple holes in a strip and draw it into the pde modeler
for j=0:(num_rep_x-1)
for i=0:(num_holes_y-1)
%calculate the x and y position for the current hole
x_center=x_start+j*x_interval;
y_center=y_start-i*y_interval;
pdecirc(x_center, y_center,radius)
hold on;
end
end
axis equal;
hold off;
better code as matlab suggested: but get stuck with an error:
Error in TestSkript2 (line 38)
ns(idx+1)=[‘C’,num2str(idx)];
please advise.
model = createpde;
%Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
rectx=0;
recty=0;
rect_width=1.38;
rect_height=0.2;
x_start=0.1;%starting position x circle
y_start=0.2;%starting position y circle
radius=0.005;%radius holes
num_holes_y=12;%number of repitition in the y
num_rep_x=7;%number of repitition in the x
y_interval=0.0183; %distance between the holes in the y;
x_interval=0.2; % distance between the holes in the x;
R1=[3,4,rectx, rectx+rect_width,rectx+rect_width,rectx,recty,recty,recty+rect_height,recty+rect_height]’;
%preallocating the arrays(more efficient for matlab CHAT GPT)
num_circles = num_holes_y * num_rep_x;
gd = zeros(10, 1 + num_circles);
gd(:, 1) = R1;
ns = cell(1+num_circles,1);
ns{ones}=’R1′;
sf=’R1′;
%create multiple holes in a strip and draw it into the pde modeler
for j=0:(num_rep_x-1)
for i=0:(num_holes_y-1)
%calculate the x and y position for the current hole
x_center=x_start+j*x_interval;
y_center=y_start-i*y_interval;
C=[1,x_center, y_center,radius]’;
idx=j*num_holes_y+i+1;
gd(1:4,idx+1)=C;
ns{idx+1}=[‘C’,num2str(idx)];
sf=[sf,’C’,num2str(idx)];
end
end
ns=char(ns);
g=decsg(gd,sf,ns);
axis equal;
hold off;Hi,
Matlab suggested me to create a more efficient code: what i am trying to do is to create 12 holes vertically in a strip of wire and repeat it 7x times over a 0.2 distance: i started with this code:
model = createpde;
%Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
rectx=0;
recty=0;
rect_width=1.38;
rect_height=0.2;
x_start=0.1;%starting position x circle
y_start=0.2;%starting position y circle
radius=0.005;%radius holes
num_holes_y=12;%number of repitition in the y
num_rep_x=7;%number of repitition in the x
y_interval=0.0183; %distance between the holes in the y;
x_interval=0.2; % distance between the holes in the x;
pderect([rectx rect_width recty,rect_height] )
%create multiple holes in a strip and draw it into the pde modeler
for j=0:(num_rep_x-1)
for i=0:(num_holes_y-1)
%calculate the x and y position for the current hole
x_center=x_start+j*x_interval;
y_center=y_start-i*y_interval;
pdecirc(x_center, y_center,radius)
hold on;
end
end
axis equal;
hold off;
better code as matlab suggested: but get stuck with an error:
Error in TestSkript2 (line 38)
ns(idx+1)=[‘C’,num2str(idx)];
please advise.
model = createpde;
%Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
rectx=0;
recty=0;
rect_width=1.38;
rect_height=0.2;
x_start=0.1;%starting position x circle
y_start=0.2;%starting position y circle
radius=0.005;%radius holes
num_holes_y=12;%number of repitition in the y
num_rep_x=7;%number of repitition in the x
y_interval=0.0183; %distance between the holes in the y;
x_interval=0.2; % distance between the holes in the x;
R1=[3,4,rectx, rectx+rect_width,rectx+rect_width,rectx,recty,recty,recty+rect_height,recty+rect_height]’;
%preallocating the arrays(more efficient for matlab CHAT GPT)
num_circles = num_holes_y * num_rep_x;
gd = zeros(10, 1 + num_circles);
gd(:, 1) = R1;
ns = cell(1+num_circles,1);
ns{ones}=’R1′;
sf=’R1′;
%create multiple holes in a strip and draw it into the pde modeler
for j=0:(num_rep_x-1)
for i=0:(num_holes_y-1)
%calculate the x and y position for the current hole
x_center=x_start+j*x_interval;
y_center=y_start-i*y_interval;
C=[1,x_center, y_center,radius]’;
idx=j*num_holes_y+i+1;
gd(1:4,idx+1)=C;
ns{idx+1}=[‘C’,num2str(idx)];
sf=[sf,’C’,num2str(idx)];
end
end
ns=char(ns);
g=decsg(gd,sf,ns);
axis equal;
hold off; Hi,
Matlab suggested me to create a more efficient code: what i am trying to do is to create 12 holes vertically in a strip of wire and repeat it 7x times over a 0.2 distance: i started with this code:
model = createpde;
%Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
rectx=0;
recty=0;
rect_width=1.38;
rect_height=0.2;
x_start=0.1;%starting position x circle
y_start=0.2;%starting position y circle
radius=0.005;%radius holes
num_holes_y=12;%number of repitition in the y
num_rep_x=7;%number of repitition in the x
y_interval=0.0183; %distance between the holes in the y;
x_interval=0.2; % distance between the holes in the x;
pderect([rectx rect_width recty,rect_height] )
%create multiple holes in a strip and draw it into the pde modeler
for j=0:(num_rep_x-1)
for i=0:(num_holes_y-1)
%calculate the x and y position for the current hole
x_center=x_start+j*x_interval;
y_center=y_start-i*y_interval;
pdecirc(x_center, y_center,radius)
hold on;
end
end
axis equal;
hold off;
better code as matlab suggested: but get stuck with an error:
Error in TestSkript2 (line 38)
ns(idx+1)=[‘C’,num2str(idx)];
please advise.
model = createpde;
%Define a circle in a rectangle, place these in one matrix, and create a set formula that subtracts the circle from the rectangle.
rectx=0;
recty=0;
rect_width=1.38;
rect_height=0.2;
x_start=0.1;%starting position x circle
y_start=0.2;%starting position y circle
radius=0.005;%radius holes
num_holes_y=12;%number of repitition in the y
num_rep_x=7;%number of repitition in the x
y_interval=0.0183; %distance between the holes in the y;
x_interval=0.2; % distance between the holes in the x;
R1=[3,4,rectx, rectx+rect_width,rectx+rect_width,rectx,recty,recty,recty+rect_height,recty+rect_height]’;
%preallocating the arrays(more efficient for matlab CHAT GPT)
num_circles = num_holes_y * num_rep_x;
gd = zeros(10, 1 + num_circles);
gd(:, 1) = R1;
ns = cell(1+num_circles,1);
ns{ones}=’R1′;
sf=’R1′;
%create multiple holes in a strip and draw it into the pde modeler
for j=0:(num_rep_x-1)
for i=0:(num_holes_y-1)
%calculate the x and y position for the current hole
x_center=x_start+j*x_interval;
y_center=y_start-i*y_interval;
C=[1,x_center, y_center,radius]’;
idx=j*num_holes_y+i+1;
gd(1:4,idx+1)=C;
ns{idx+1}=[‘C’,num2str(idx)];
sf=[sf,’C’,num2str(idx)];
end
end
ns=char(ns);
g=decsg(gd,sf,ns);
axis equal;
hold off; pde modeler script. MATLAB Answers — New Questions
Mex Build Error: the following files have the same file name which cannot be packaged together in a flat hierarchy
I have files that multiple Sfuns use. When I want to build the project, I get the following error. What is the reason for this and is there a solution?
"the following files have the same file name which cannot be packaged together in a flat hierarchy"I have files that multiple Sfuns use. When I want to build the project, I get the following error. What is the reason for this and is there a solution?
"the following files have the same file name which cannot be packaged together in a flat hierarchy" I have files that multiple Sfuns use. When I want to build the project, I get the following error. What is the reason for this and is there a solution?
"the following files have the same file name which cannot be packaged together in a flat hierarchy" simulink, embedded coder, code generation MATLAB Answers — New Questions
Simscape Multibody Model with Elastic tooth mesh
Hi everybody,
I want to simulate an elastic tooth mesh within my simscape multibody model. The model is very simple and consists only two gears. The model works fine with the "Common Gear Constraint" block, but I want to simulate spring and damping effects. Therefore I added a Torsional Spring-Damper which I connected to the model via a Rotational Multibody Interface.
Error:An error occurred during simulation and the simulation was terminated
Caused by:
[‘Test_ElastischerZahneingriff_1/Solver Configuration’]: Initial conditions solve failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
The model may not give enough information to make it possible to solve for values of some of its variables. Specific advice is given below.
all components and nodal across variables involved
Tie variable ‘Torsional_Spring_Damper.R.w’ (Rotational velocity) to a definite value, for example by connecting an appropriate domain reference block.
Dependency found among topology equations. Check for missing reference node.
Is anybody out there who can help me fixing this error?
You can see the model in the pictures.
Thank’s everybody for any helpful comment….
Kind regards,
ThomasHi everybody,
I want to simulate an elastic tooth mesh within my simscape multibody model. The model is very simple and consists only two gears. The model works fine with the "Common Gear Constraint" block, but I want to simulate spring and damping effects. Therefore I added a Torsional Spring-Damper which I connected to the model via a Rotational Multibody Interface.
Error:An error occurred during simulation and the simulation was terminated
Caused by:
[‘Test_ElastischerZahneingriff_1/Solver Configuration’]: Initial conditions solve failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
The model may not give enough information to make it possible to solve for values of some of its variables. Specific advice is given below.
all components and nodal across variables involved
Tie variable ‘Torsional_Spring_Damper.R.w’ (Rotational velocity) to a definite value, for example by connecting an appropriate domain reference block.
Dependency found among topology equations. Check for missing reference node.
Is anybody out there who can help me fixing this error?
You can see the model in the pictures.
Thank’s everybody for any helpful comment….
Kind regards,
Thomas Hi everybody,
I want to simulate an elastic tooth mesh within my simscape multibody model. The model is very simple and consists only two gears. The model works fine with the "Common Gear Constraint" block, but I want to simulate spring and damping effects. Therefore I added a Torsional Spring-Damper which I connected to the model via a Rotational Multibody Interface.
Error:An error occurred during simulation and the simulation was terminated
Caused by:
[‘Test_ElastischerZahneingriff_1/Solver Configuration’]: Initial conditions solve failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
The model may not give enough information to make it possible to solve for values of some of its variables. Specific advice is given below.
all components and nodal across variables involved
Tie variable ‘Torsional_Spring_Damper.R.w’ (Rotational velocity) to a definite value, for example by connecting an appropriate domain reference block.
Dependency found among topology equations. Check for missing reference node.
Is anybody out there who can help me fixing this error?
You can see the model in the pictures.
Thank’s everybody for any helpful comment….
Kind regards,
Thomas simscape, multibody, gear, elastic tooth mesh MATLAB Answers — New Questions
How do I install STM32Cube Firmware manually for use with the “Embedded Coder Support Package for STMicroelectronics STM32 Processors”?
During the Hardware Setup for the "Embedded Coder Support Package for STMicroelectronics STM32 Processors", the step "Install STM32Cube Firmware" fails with the error "Installation of STM32Cube firmware failed with the following error" as shown in the screenshot below.
Is there a different way to download the STM32Cube firmware for use with MATLAB/Simulink?During the Hardware Setup for the "Embedded Coder Support Package for STMicroelectronics STM32 Processors", the step "Install STM32Cube Firmware" fails with the error "Installation of STM32Cube firmware failed with the following error" as shown in the screenshot below.
Is there a different way to download the STM32Cube firmware for use with MATLAB/Simulink? During the Hardware Setup for the "Embedded Coder Support Package for STMicroelectronics STM32 Processors", the step "Install STM32Cube Firmware" fails with the error "Installation of STM32Cube firmware failed with the following error" as shown in the screenshot below.
Is there a different way to download the STM32Cube firmware for use with MATLAB/Simulink? offline, firewall, cubemx, stm32cubemx, firmware, stm32, setup MATLAB Answers — New Questions
Simulink build TI CCS Project error.
Post Content Post Content ccs ti MATLAB Answers — New Questions
Equivalence of MSK and Offset QPSK
Hi everyone,
i’m currently trying to create a offset QPSK modulation using an MSK with a half-sine matched filter. This is based on the IEEE paper https://ieeexplore.ieee.org/document/4102435. I generated an OQPSK and MSK signal with MATLAB and plotted the angle of the signal. Both can be seen below. There is no frequency error or noise. They spectrum for both is the same and the amplitude of the symbol stays constant, so this is indeed a OQPSK signal. Just the resulting bits are different.
I can demodulated the OQPSK using the OQPSK demodulation function from the Communications Toolbox as well as the with the symbol order based on the phase seen in the picture. So the OQPSK is correct. I can also demodulate the MSK with a normal FSK demodulater and the ouput is the same as with the OQPSK. But when applying any kinf of OQPSK demodulation to the MSK signal the resulting sequence is different as well as the phase (picture).
So is a MSK with Half-Sine Filter really equivalent to an OQPSK and both can be received with the same receiver?
This is the phase of the MSK signal
And this is the phase of the OQPSK signal
Best Regards,
AxelHi everyone,
i’m currently trying to create a offset QPSK modulation using an MSK with a half-sine matched filter. This is based on the IEEE paper https://ieeexplore.ieee.org/document/4102435. I generated an OQPSK and MSK signal with MATLAB and plotted the angle of the signal. Both can be seen below. There is no frequency error or noise. They spectrum for both is the same and the amplitude of the symbol stays constant, so this is indeed a OQPSK signal. Just the resulting bits are different.
I can demodulated the OQPSK using the OQPSK demodulation function from the Communications Toolbox as well as the with the symbol order based on the phase seen in the picture. So the OQPSK is correct. I can also demodulate the MSK with a normal FSK demodulater and the ouput is the same as with the OQPSK. But when applying any kinf of OQPSK demodulation to the MSK signal the resulting sequence is different as well as the phase (picture).
So is a MSK with Half-Sine Filter really equivalent to an OQPSK and both can be received with the same receiver?
This is the phase of the MSK signal
And this is the phase of the OQPSK signal
Best Regards,
Axel Hi everyone,
i’m currently trying to create a offset QPSK modulation using an MSK with a half-sine matched filter. This is based on the IEEE paper https://ieeexplore.ieee.org/document/4102435. I generated an OQPSK and MSK signal with MATLAB and plotted the angle of the signal. Both can be seen below. There is no frequency error or noise. They spectrum for both is the same and the amplitude of the symbol stays constant, so this is indeed a OQPSK signal. Just the resulting bits are different.
I can demodulated the OQPSK using the OQPSK demodulation function from the Communications Toolbox as well as the with the symbol order based on the phase seen in the picture. So the OQPSK is correct. I can also demodulate the MSK with a normal FSK demodulater and the ouput is the same as with the OQPSK. But when applying any kinf of OQPSK demodulation to the MSK signal the resulting sequence is different as well as the phase (picture).
So is a MSK with Half-Sine Filter really equivalent to an OQPSK and both can be received with the same receiver?
This is the phase of the MSK signal
And this is the phase of the OQPSK signal
Best Regards,
Axel msk, oqpsk MATLAB Answers — New Questions
You have to transmit Data Sequence 11100010 with transmission bit rate 1000000 through QPSK. Write a Matlab code and a) Generate data sequence and all the above mentioned wave
clear all
close all
Data_Seq=[1,1,1,0,0,0,1,0]
stem(Data_Seq)
bitrate= 1000000;
SR=1/bitrate;
ylim([-1 1])
t=0:0.01:length(Data_Seq)
Data_Seq2=[1,1,1,-1,-1,-1,1,-1]
stem(Data_Seq2)
A = Data_Seq2(1:2:end,:) %
B = Data_Seq2(2:2:end,:)
stem(A)
even = Data_Seq(2:2:end);
odd = Data_Seq(1:2:end);
stem(even)
// i Want to seperate even and odd signal but not undrstanding how to plotclear all
close all
Data_Seq=[1,1,1,0,0,0,1,0]
stem(Data_Seq)
bitrate= 1000000;
SR=1/bitrate;
ylim([-1 1])
t=0:0.01:length(Data_Seq)
Data_Seq2=[1,1,1,-1,-1,-1,1,-1]
stem(Data_Seq2)
A = Data_Seq2(1:2:end,:) %
B = Data_Seq2(2:2:end,:)
stem(A)
even = Data_Seq(2:2:end);
odd = Data_Seq(1:2:end);
stem(even)
// i Want to seperate even and odd signal but not undrstanding how to plot clear all
close all
Data_Seq=[1,1,1,0,0,0,1,0]
stem(Data_Seq)
bitrate= 1000000;
SR=1/bitrate;
ylim([-1 1])
t=0:0.01:length(Data_Seq)
Data_Seq2=[1,1,1,-1,-1,-1,1,-1]
stem(Data_Seq2)
A = Data_Seq2(1:2:end,:) %
B = Data_Seq2(2:2:end,:)
stem(A)
even = Data_Seq(2:2:end);
odd = Data_Seq(1:2:end);
stem(even)
// i Want to seperate even and odd signal but not undrstanding how to plot qpsk modulation MATLAB Answers — New Questions