Tag Archives: matlab
UWB ranging or localization using IEEE 802.15.4z
How to get the measurements with a random walk?
I know that the physical signal has added a random noise, but the measurements are same when I run some times. I simulate the physical measurements, they should be different in practice, How to solve it? I try to change the sigPower in awgn, but it does not work, the measurements are still same.How to get the measurements with a random walk?
I know that the physical signal has added a random noise, but the measurements are same when I run some times. I simulate the physical measurements, they should be different in practice, How to solve it? I try to change the sigPower in awgn, but it does not work, the measurements are still same. How to get the measurements with a random walk?
I know that the physical signal has added a random noise, but the measurements are same when I run some times. I simulate the physical measurements, they should be different in practice, How to solve it? I try to change the sigPower in awgn, but it does not work, the measurements are still same. uwb localization, measurement MATLAB Answers — New Questions
Why is Curve fitting tool not giving good results even with the R-square value of 0.99?
I am trying to extract the equation from the matlab example of wind turbine controller design. There is CpData, TSRgrid and Bgrid. But I am unable to get any useful equation from it. At last I used linear curve fitting based on two variables. But results which should be close to 0.48 something are like in -500. It is weird for me. Please do help what I am doing wrong.I am trying to extract the equation from the matlab example of wind turbine controller design. There is CpData, TSRgrid and Bgrid. But I am unable to get any useful equation from it. At last I used linear curve fitting based on two variables. But results which should be close to 0.48 something are like in -500. It is weird for me. Please do help what I am doing wrong. I am trying to extract the equation from the matlab example of wind turbine controller design. There is CpData, TSRgrid and Bgrid. But I am unable to get any useful equation from it. At last I used linear curve fitting based on two variables. But results which should be close to 0.48 something are like in -500. It is weird for me. Please do help what I am doing wrong. curve fitting, wind plant, power coefficient MATLAB Answers — New Questions
Why is my matlab installer stuck on loading?
I have downloaded the MATLAB installer but when I open it and sign in it results in a continuous loading screen. Does anyone know how to fix this?I have downloaded the MATLAB installer but when I open it and sign in it results in a continuous loading screen. Does anyone know how to fix this? I have downloaded the MATLAB installer but when I open it and sign in it results in a continuous loading screen. Does anyone know how to fix this? installation MATLAB Answers — New Questions
Are there restrictions on the types of orders you can make from vendors in the Datafeed Toolbox?
I am interested in using the Datafeed Toolbox to do some trading, and was wondering if there were limitations on the orders I could do?I am interested in using the Datafeed Toolbox to do some trading, and was wondering if there were limitations on the orders I could do? I am interested in using the Datafeed Toolbox to do some trading, and was wondering if there were limitations on the orders I could do? datafeed, trade, orderrestrictions MATLAB Answers — New Questions
calculate covariance function for stochastic process
Hello everyone..I have a simple question..do you know how to calculate and plot covariance function in matlab if the covariance matrix is known? let’s say I want to find the covariance function using 3×3 matrix..I have searched anywhere about covariance function but all I got is cov(), is this correct? any response is really appreciated, thxHello everyone..I have a simple question..do you know how to calculate and plot covariance function in matlab if the covariance matrix is known? let’s say I want to find the covariance function using 3×3 matrix..I have searched anywhere about covariance function but all I got is cov(), is this correct? any response is really appreciated, thx Hello everyone..I have a simple question..do you know how to calculate and plot covariance function in matlab if the covariance matrix is known? let’s say I want to find the covariance function using 3×3 matrix..I have searched anywhere about covariance function but all I got is cov(), is this correct? any response is really appreciated, thx matlab MATLAB Answers — New Questions
enlarge a curved arc with rounded edges, only from the rounded edge
This is an imagesc of a segmented matrix of a curved cell and I want to enlarge it but only from the ends of the curve (red)This is an imagesc of a segmented matrix of a curved cell and I want to enlarge it but only from the ends of the curve (red) This is an imagesc of a segmented matrix of a curved cell and I want to enlarge it but only from the ends of the curve (red) extend arc MATLAB Answers — New Questions
FOR Loops for genearting multiple plots and using only one Column of Data from Each Table (Multiple Tables Present)
Hello,
I have a Cell Variable named Complete_Table. Which has multiple Tables within it (3 in the example shown in attached images). I would like to make plots using FOR Loop where in I can Only use the the Third Column of Each Table under Complete Table aganist a Static X-Axis with ("LG","MG","CG") as names No Data in General. In Simple Words the X-Axis doesn’t change so that is not a Issue. In my Loop the Script I have added below I am not able to dynamically index for the Y-Data to Change from First Table (Var1_3) to Second Table (Var2_3) to Third_Table(Var3_3) and So on.
Also The Variable names here are seem same but are different. Like Var1_3 is associated with First Table and Var2_3 is associated with Second table.
for op = 1:length(Complete_table) % Helps us learn the number of tables present in the Cell.
figure;% Produces the Same number of figurs as number of Tables or varable op.
Y_Data = Complete_Data(op()); % here it When op =1 it is looking at the first table but not sure how to proceed for it to look at Var1_3 and so on & so forth.
plot()
end
Any suggestion in the right direction would be great.
Thank you for your time and effort..Hello,
I have a Cell Variable named Complete_Table. Which has multiple Tables within it (3 in the example shown in attached images). I would like to make plots using FOR Loop where in I can Only use the the Third Column of Each Table under Complete Table aganist a Static X-Axis with ("LG","MG","CG") as names No Data in General. In Simple Words the X-Axis doesn’t change so that is not a Issue. In my Loop the Script I have added below I am not able to dynamically index for the Y-Data to Change from First Table (Var1_3) to Second Table (Var2_3) to Third_Table(Var3_3) and So on.
Also The Variable names here are seem same but are different. Like Var1_3 is associated with First Table and Var2_3 is associated with Second table.
for op = 1:length(Complete_table) % Helps us learn the number of tables present in the Cell.
figure;% Produces the Same number of figurs as number of Tables or varable op.
Y_Data = Complete_Data(op()); % here it When op =1 it is looking at the first table but not sure how to proceed for it to look at Var1_3 and so on & so forth.
plot()
end
Any suggestion in the right direction would be great.
Thank you for your time and effort.. Hello,
I have a Cell Variable named Complete_Table. Which has multiple Tables within it (3 in the example shown in attached images). I would like to make plots using FOR Loop where in I can Only use the the Third Column of Each Table under Complete Table aganist a Static X-Axis with ("LG","MG","CG") as names No Data in General. In Simple Words the X-Axis doesn’t change so that is not a Issue. In my Loop the Script I have added below I am not able to dynamically index for the Y-Data to Change from First Table (Var1_3) to Second Table (Var2_3) to Third_Table(Var3_3) and So on.
Also The Variable names here are seem same but are different. Like Var1_3 is associated with First Table and Var2_3 is associated with Second table.
for op = 1:length(Complete_table) % Helps us learn the number of tables present in the Cell.
figure;% Produces the Same number of figurs as number of Tables or varable op.
Y_Data = Complete_Data(op()); % here it When op =1 it is looking at the first table but not sure how to proceed for it to look at Var1_3 and so on & so forth.
plot()
end
Any suggestion in the right direction would be great.
Thank you for your time and effort.. for loop, plotting MATLAB Answers — New Questions
Where can I download Matlab compiler for R2009a version
Dear All,
I am looking for Matlab compiler compatible for R2009a version.
How can I do that?Dear All,
I am looking for Matlab compiler compatible for R2009a version.
How can I do that? Dear All,
I am looking for Matlab compiler compatible for R2009a version.
How can I do that? matlab compiler MATLAB Answers — New Questions
using mask parameter in Matlab Function block
Hi everyone
I’ve created a mask for a Matab-Function block.
How can I use the mask parameters in Matlab-Function block function?Hi everyone
I’ve created a mask for a Matab-Function block.
How can I use the mask parameters in Matlab-Function block function? Hi everyone
I’ve created a mask for a Matab-Function block.
How can I use the mask parameters in Matlab-Function block function? mask, paramerter MATLAB Answers — New Questions
Python – MATLAB not working: MATLAB cant find python environment, numpy not working, fooof not working
Hi everyone,
I’ve been stuck on trying to run some matlab-python code for a week now and nothing seems to work. I am trying to run the following code: https://github.com/fooof-tools/fooof_mat?tab=readme-ov-file which requires python to be compatible with MATLAB. I’ve read so many things but nothing has worked so far. This is my first time trying to code in python-matlab simultaneously so the answer might be something simple that I am just not aware of.
What has worked so far:
I created a new environment called ‘env’ which is located in location ‘fri_test’. In this environment I have installed fooof, matlibplot, pandas.
Then, I open a fresh MATLAB window and type in the following:
pyenv
This is the output:
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/c1034944/fri_test/env/bin/python"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Users/c1034944/fri_test/env"
Status: NotLoaded
ExecutionMode: InProcess
I then run:
python_env_path = ‘/Users/c1034944/fri_test/env/bin/python’
pyenv("Version",python_env_path);
py.list({‘This’,’is a’,’list’})
output:
ans =
Python list with no properties.
[‘This’, ‘is a’, ‘list’]
Lastly, run this again to check the python environment:
pyenv
output:
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/c1034944/fri_test/env/bin/python"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Users/c1034944/fri_test/env"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "42704"
ProcessName: "MATLAB"
As you can see the ‘executable’ is finding the correct location of the environment I created in fri_test. The ‘ExecutionMode’ has also now updated to ‘InProcess’. However, the ‘Library" is still calling the python version from the Library/Developer.
To test if numpy is working, I run the following:
freq=([0 0.9766 1.9531 2.9297])
py.numpy.array(freq)
this is the error message:
Unable to resolve the name py.numpy.array.
More info: The ‘fooof’ code I am trying to run contains the following line: py.numpy.array(freqs), where ‘freqs’ is a list of 1 x 257 numbers. To my understanding py.numpy.array(freqs) converts the matlab (.mat) file ‘freqs’ into a python-compatible array.
Conclusion: I have no idea what is the issue here and why numpy is not working. I know that MATLAB and python versions are compatible, but maybe I am making a different mistake. I am hoping that finding a solution to numpy problem and that may fix the whole issue – is there any other way to convert .mat files into python arrays?
Any suggestions would be helpful!
Healthy Regards,
VyteHi everyone,
I’ve been stuck on trying to run some matlab-python code for a week now and nothing seems to work. I am trying to run the following code: https://github.com/fooof-tools/fooof_mat?tab=readme-ov-file which requires python to be compatible with MATLAB. I’ve read so many things but nothing has worked so far. This is my first time trying to code in python-matlab simultaneously so the answer might be something simple that I am just not aware of.
What has worked so far:
I created a new environment called ‘env’ which is located in location ‘fri_test’. In this environment I have installed fooof, matlibplot, pandas.
Then, I open a fresh MATLAB window and type in the following:
pyenv
This is the output:
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/c1034944/fri_test/env/bin/python"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Users/c1034944/fri_test/env"
Status: NotLoaded
ExecutionMode: InProcess
I then run:
python_env_path = ‘/Users/c1034944/fri_test/env/bin/python’
pyenv("Version",python_env_path);
py.list({‘This’,’is a’,’list’})
output:
ans =
Python list with no properties.
[‘This’, ‘is a’, ‘list’]
Lastly, run this again to check the python environment:
pyenv
output:
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/c1034944/fri_test/env/bin/python"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Users/c1034944/fri_test/env"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "42704"
ProcessName: "MATLAB"
As you can see the ‘executable’ is finding the correct location of the environment I created in fri_test. The ‘ExecutionMode’ has also now updated to ‘InProcess’. However, the ‘Library" is still calling the python version from the Library/Developer.
To test if numpy is working, I run the following:
freq=([0 0.9766 1.9531 2.9297])
py.numpy.array(freq)
this is the error message:
Unable to resolve the name py.numpy.array.
More info: The ‘fooof’ code I am trying to run contains the following line: py.numpy.array(freqs), where ‘freqs’ is a list of 1 x 257 numbers. To my understanding py.numpy.array(freqs) converts the matlab (.mat) file ‘freqs’ into a python-compatible array.
Conclusion: I have no idea what is the issue here and why numpy is not working. I know that MATLAB and python versions are compatible, but maybe I am making a different mistake. I am hoping that finding a solution to numpy problem and that may fix the whole issue – is there any other way to convert .mat files into python arrays?
Any suggestions would be helpful!
Healthy Regards,
Vyte Hi everyone,
I’ve been stuck on trying to run some matlab-python code for a week now and nothing seems to work. I am trying to run the following code: https://github.com/fooof-tools/fooof_mat?tab=readme-ov-file which requires python to be compatible with MATLAB. I’ve read so many things but nothing has worked so far. This is my first time trying to code in python-matlab simultaneously so the answer might be something simple that I am just not aware of.
What has worked so far:
I created a new environment called ‘env’ which is located in location ‘fri_test’. In this environment I have installed fooof, matlibplot, pandas.
Then, I open a fresh MATLAB window and type in the following:
pyenv
This is the output:
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/c1034944/fri_test/env/bin/python"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Users/c1034944/fri_test/env"
Status: NotLoaded
ExecutionMode: InProcess
I then run:
python_env_path = ‘/Users/c1034944/fri_test/env/bin/python’
pyenv("Version",python_env_path);
py.list({‘This’,’is a’,’list’})
output:
ans =
Python list with no properties.
[‘This’, ‘is a’, ‘list’]
Lastly, run this again to check the python environment:
pyenv
output:
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/c1034944/fri_test/env/bin/python"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Users/c1034944/fri_test/env"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "42704"
ProcessName: "MATLAB"
As you can see the ‘executable’ is finding the correct location of the environment I created in fri_test. The ‘ExecutionMode’ has also now updated to ‘InProcess’. However, the ‘Library" is still calling the python version from the Library/Developer.
To test if numpy is working, I run the following:
freq=([0 0.9766 1.9531 2.9297])
py.numpy.array(freq)
this is the error message:
Unable to resolve the name py.numpy.array.
More info: The ‘fooof’ code I am trying to run contains the following line: py.numpy.array(freqs), where ‘freqs’ is a list of 1 x 257 numbers. To my understanding py.numpy.array(freqs) converts the matlab (.mat) file ‘freqs’ into a python-compatible array.
Conclusion: I have no idea what is the issue here and why numpy is not working. I know that MATLAB and python versions are compatible, but maybe I am making a different mistake. I am hoping that finding a solution to numpy problem and that may fix the whole issue – is there any other way to convert .mat files into python arrays?
Any suggestions would be helpful!
Healthy Regards,
Vyte fooof, python, matlab, matlab python, numpy, python array, library, executable MATLAB Answers — New Questions
Why is MATLAB R2020a, R2020b, or R2023b not detecting a silent Support Package installation?
I installed a Support Package silently with an offline Support Package download. When I open MATLAB, the support package doesn’t appear to be installed when checking Add-ons>Manage or when running:
matlabshared.supportpkg.getInstalledI installed a Support Package silently with an offline Support Package download. When I open MATLAB, the support package doesn’t appear to be installed when checking Add-ons>Manage or when running:
matlabshared.supportpkg.getInstalled I installed a Support Package silently with an offline Support Package download. When I open MATLAB, the support package doesn’t appear to be installed when checking Add-ons>Manage or when running:
matlabshared.supportpkg.getInstalled MATLAB Answers — New Questions
Equivalent Methods of Python __setitem__ and _getitem__ methods
What are the equivalent methods in matlab of the python methods __setitem__ and _getitem__?
Thank you,
VirginioWhat are the equivalent methods in matlab of the python methods __setitem__ and _getitem__?
Thank you,
Virginio What are the equivalent methods in matlab of the python methods __setitem__ and _getitem__?
Thank you,
Virginio python MATLAB Answers — New Questions
Extend only two lines on a plot
I made a plot on Matlab with three experimental data lines and two theoretical. I need to extend only the two theoretical (Vturb and Vlam) to the top of the plot. Everything I’ve tried has not worked so any ideas would be much appreciated.
%140%
DP140= [0.200 0.192 0.182 0.170 0.162 0.151 0.138 0.132 0.130 0.122 0.117 0.108 0.102 0.087 0.076];
DPlb140=DP140*5.20;
V140=((2*DPlb140)/0.00238).^(1/2);
VCL140 = V140/29.5626;
%60 Hz%
DP60 = [0.043 0.045 0.042 0.040 0.038 0.037 0.035 0.032 0.031 0.031 0.027 0.026 0.024 0.021 0.018];
DPlb60=DP60*5.20;
V60=((2*DPlb60)/0.00238).^(1/2);
VCL60 = V60/13.7076;
%100 Hz%
DP100 = [0.123 0.118 0.112 0.108 0.103 0.095 0.089 0.085 0.081 0.078 0.075 0.065 0.062 0.057 0.042];
DPlb100=DP100*5.20;
V100=((2*DPlb100)/0.00238).^(1/2);
r = [0 2 4 6 8 10 12 14 16 18 20 22 24 26 28]/304.8;
R = 0.125;
rR = r/R;
VCL100 = V100/23.1836;
Vlam = (1-rR.^2);
Vturb = (1-rR).^(1/7);
plot(VCL140, rR)
hold on
plot(VCL60, rR)
plot(VCL100, rR)
plot(Vturb,rR)
plot(Vlam,rR)
ylabel("r/R")
xlabel("V/Vcl")
title("Velocites vs. Distance")
legend("Meas V140","Meas V60","Meas V100", "Laminar", "Turbulent")
hold offI made a plot on Matlab with three experimental data lines and two theoretical. I need to extend only the two theoretical (Vturb and Vlam) to the top of the plot. Everything I’ve tried has not worked so any ideas would be much appreciated.
%140%
DP140= [0.200 0.192 0.182 0.170 0.162 0.151 0.138 0.132 0.130 0.122 0.117 0.108 0.102 0.087 0.076];
DPlb140=DP140*5.20;
V140=((2*DPlb140)/0.00238).^(1/2);
VCL140 = V140/29.5626;
%60 Hz%
DP60 = [0.043 0.045 0.042 0.040 0.038 0.037 0.035 0.032 0.031 0.031 0.027 0.026 0.024 0.021 0.018];
DPlb60=DP60*5.20;
V60=((2*DPlb60)/0.00238).^(1/2);
VCL60 = V60/13.7076;
%100 Hz%
DP100 = [0.123 0.118 0.112 0.108 0.103 0.095 0.089 0.085 0.081 0.078 0.075 0.065 0.062 0.057 0.042];
DPlb100=DP100*5.20;
V100=((2*DPlb100)/0.00238).^(1/2);
r = [0 2 4 6 8 10 12 14 16 18 20 22 24 26 28]/304.8;
R = 0.125;
rR = r/R;
VCL100 = V100/23.1836;
Vlam = (1-rR.^2);
Vturb = (1-rR).^(1/7);
plot(VCL140, rR)
hold on
plot(VCL60, rR)
plot(VCL100, rR)
plot(Vturb,rR)
plot(Vlam,rR)
ylabel("r/R")
xlabel("V/Vcl")
title("Velocites vs. Distance")
legend("Meas V140","Meas V60","Meas V100", "Laminar", "Turbulent")
hold off I made a plot on Matlab with three experimental data lines and two theoretical. I need to extend only the two theoretical (Vturb and Vlam) to the top of the plot. Everything I’ve tried has not worked so any ideas would be much appreciated.
%140%
DP140= [0.200 0.192 0.182 0.170 0.162 0.151 0.138 0.132 0.130 0.122 0.117 0.108 0.102 0.087 0.076];
DPlb140=DP140*5.20;
V140=((2*DPlb140)/0.00238).^(1/2);
VCL140 = V140/29.5626;
%60 Hz%
DP60 = [0.043 0.045 0.042 0.040 0.038 0.037 0.035 0.032 0.031 0.031 0.027 0.026 0.024 0.021 0.018];
DPlb60=DP60*5.20;
V60=((2*DPlb60)/0.00238).^(1/2);
VCL60 = V60/13.7076;
%100 Hz%
DP100 = [0.123 0.118 0.112 0.108 0.103 0.095 0.089 0.085 0.081 0.078 0.075 0.065 0.062 0.057 0.042];
DPlb100=DP100*5.20;
V100=((2*DPlb100)/0.00238).^(1/2);
r = [0 2 4 6 8 10 12 14 16 18 20 22 24 26 28]/304.8;
R = 0.125;
rR = r/R;
VCL100 = V100/23.1836;
Vlam = (1-rR.^2);
Vturb = (1-rR).^(1/7);
plot(VCL140, rR)
hold on
plot(VCL60, rR)
plot(VCL100, rR)
plot(Vturb,rR)
plot(Vlam,rR)
ylabel("r/R")
xlabel("V/Vcl")
title("Velocites vs. Distance")
legend("Meas V140","Meas V60","Meas V100", "Laminar", "Turbulent")
hold off plotting, plot MATLAB Answers — New Questions
how do I create array with numbers and characters to then put into a table?
I’m trying to create a table from an array for which I need empty certain coluns to display blank (or NA). I tried this….
switch n
case 1
sumT =array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 2
sumT =array2table({k,ZIA,’_’,f1,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 3
sumT =array2table([k,ZIA,’_’,’_’,f2,’_’,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 4
sumT =array2table([k,ZIA,’_’,’_’,’_’,f2pk,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
otherwise
disp(‘oops’)
end
I’ve tried :
array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}…
array2table([k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload]…
array2table([{k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}]….
etc, but none of these combinations seem to work.
sumT =array2table([k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
results in :
this one,
sumT =array2table([{k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload}],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
generates this output.
How do I display the contents of the "containers}?
how can I include doubles and blanks in the same array and then display them as such in a table?
Thank you.I’m trying to create a table from an array for which I need empty certain coluns to display blank (or NA). I tried this….
switch n
case 1
sumT =array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 2
sumT =array2table({k,ZIA,’_’,f1,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 3
sumT =array2table([k,ZIA,’_’,’_’,f2,’_’,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 4
sumT =array2table([k,ZIA,’_’,’_’,’_’,f2pk,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
otherwise
disp(‘oops’)
end
I’ve tried :
array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}…
array2table([k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload]…
array2table([{k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}]….
etc, but none of these combinations seem to work.
sumT =array2table([k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
results in :
this one,
sumT =array2table([{k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload}],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
generates this output.
How do I display the contents of the "containers}?
how can I include doubles and blanks in the same array and then display them as such in a table?
Thank you. I’m trying to create a table from an array for which I need empty certain coluns to display blank (or NA). I tried this….
switch n
case 1
sumT =array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 2
sumT =array2table({k,ZIA,’_’,f1,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 3
sumT =array2table([k,ZIA,’_’,’_’,f2,’_’,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 4
sumT =array2table([k,ZIA,’_’,’_’,’_’,f2pk,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
otherwise
disp(‘oops’)
end
I’ve tried :
array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}…
array2table([k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload]…
array2table([{k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}]….
etc, but none of these combinations seem to work.
sumT =array2table([k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
results in :
this one,
sumT =array2table([{k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload}],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
generates this output.
How do I display the contents of the "containers}?
how can I include doubles and blanks in the same array and then display them as such in a table?
Thank you. cell arrays, tables, mixed variables MATLAB Answers — New Questions
IT KEEP ON ASKING DOES THE BLOCK VALUE MATCHING FOLLWING PLOTTED VALUE RESISTORS V
Post Content Post Content resistor v MATLAB Answers — New Questions
How to fit this model with a Weibull distribution?
Hi. I’m trying to fit my empirical distribution with a theoretical Weibull distribution.
The problem is that I get a negative value and I can’t understand why.
I tried adding a +c constant to the Weibull function, but it only got worse:
I also tried adjusting the variables’ StartingPoint values but nothing changed.
I am pretty sure this has to work somehow.
Thank you in advance.Hi. I’m trying to fit my empirical distribution with a theoretical Weibull distribution.
The problem is that I get a negative value and I can’t understand why.
I tried adding a +c constant to the Weibull function, but it only got worse:
I also tried adjusting the variables’ StartingPoint values but nothing changed.
I am pretty sure this has to work somehow.
Thank you in advance. Hi. I’m trying to fit my empirical distribution with a theoretical Weibull distribution.
The problem is that I get a negative value and I can’t understand why.
I tried adding a +c constant to the Weibull function, but it only got worse:
I also tried adjusting the variables’ StartingPoint values but nothing changed.
I am pretty sure this has to work somehow.
Thank you in advance. statistics, curve fitting MATLAB Answers — New Questions
How do I estimate and optimize the parameters of my ODE system in MATLAB?
I have a system of ordinary differential equations (ODE) with some unknown parameters (coefficients). I want to simultaneously solve the system of differential equations as well as optimize for the unknown parameters by minimizing an objective function that depends on the solution of the ODE system.
What is the best way to do this in MATLAB?I have a system of ordinary differential equations (ODE) with some unknown parameters (coefficients). I want to simultaneously solve the system of differential equations as well as optimize for the unknown parameters by minimizing an objective function that depends on the solution of the ODE system.
What is the best way to do this in MATLAB? I have a system of ordinary differential equations (ODE) with some unknown parameters (coefficients). I want to simultaneously solve the system of differential equations as well as optimize for the unknown parameters by minimizing an objective function that depends on the solution of the ODE system.
What is the best way to do this in MATLAB? parameter, estimation, in, ode, optimize, parameters, simultaneous, optimization, and, solving, with, unknown, simulink, controls, plant, ncd, examples, tuning, odeset, reltol, abstol, maxstep, initialstep, response MATLAB Answers — New Questions
Extract data from UIAxes in AppDesigner
Hello, I’m devolping an app in AppDesigner and I want to extract data from a UIAxes.
I have several different actions before I can extract the data. I wanna press a button, after all those actions are done, and extract the data from what is plotted in the UIAxes.
Any suggestions?Hello, I’m devolping an app in AppDesigner and I want to extract data from a UIAxes.
I have several different actions before I can extract the data. I wanna press a button, after all those actions are done, and extract the data from what is plotted in the UIAxes.
Any suggestions? Hello, I’m devolping an app in AppDesigner and I want to extract data from a UIAxes.
I have several different actions before I can extract the data. I wanna press a button, after all those actions are done, and extract the data from what is plotted in the UIAxes.
Any suggestions? appdesigner, matlab gui, matlab, callback MATLAB Answers — New Questions
Plotting 1st derivative and 2nd derivative graph from a set of values
I have a set of raw data collected from a displacement time graph and i wish to convert it into a velocity time graph and acceleration time graph. Is there anyway to do that? My data is the time at each interval of displacement so I do not have enough points to plot using the (y1-y2)/(x1-x2) method to extrapolate the gradient. Is there anyway to get the derivatives from the line of best fit? I cannot just differentiate line of best fit polynomial as it becomes a straight line graph after 1.5s so the best method is to find gradient of this graph at many points and plot from there.
Data points:I have a set of raw data collected from a displacement time graph and i wish to convert it into a velocity time graph and acceleration time graph. Is there anyway to do that? My data is the time at each interval of displacement so I do not have enough points to plot using the (y1-y2)/(x1-x2) method to extrapolate the gradient. Is there anyway to get the derivatives from the line of best fit? I cannot just differentiate line of best fit polynomial as it becomes a straight line graph after 1.5s so the best method is to find gradient of this graph at many points and plot from there.
Data points: I have a set of raw data collected from a displacement time graph and i wish to convert it into a velocity time graph and acceleration time graph. Is there anyway to do that? My data is the time at each interval of displacement so I do not have enough points to plot using the (y1-y2)/(x1-x2) method to extrapolate the gradient. Is there anyway to get the derivatives from the line of best fit? I cannot just differentiate line of best fit polynomial as it becomes a straight line graph after 1.5s so the best method is to find gradient of this graph at many points and plot from there.
Data points: derivative MATLAB Answers — New Questions
how to parse text file read into cell array
I’m trying to programmatically update a Qspice netlist. I read the *.net file in using fileread.
netlist = fileread([filepath filename);
the file looks like this:
‘* netlist
L5 N08 0 {Lp} Rser = 0.01 ic=0
L6 0 N07 {Ls} Rser=0.01 ic=0
C3 N06 N08 {Cp}
C4 N07 N09 {Cs}
V2 N06 0 pulse -VGA VGA 0 3n 3n period/2 period ac=1
R1 N09 0 .01
L1 N11 0 {Lp} Rser = 0.01 ic=0
L2 0 N10 {Ls} Rser=0.01 ic=0
C1 N05 N11 {Cp}
C2 N10 N12 {Cs}
V1 N05 0 pulse -VGA VGA 0 3n 3n period/2 period
R2 N12 0 5
.tran 0 {duration} {starttran} 2n
.param fres1=83000
.param period= 1/fsw
.param Cp = 1/(Lp*(2*pi*fres1)^2)
.param Lp= 34µ
.param Ls= 34µ
.param Cp2 = Cp*2
.param Idc = 104.42
.
.param Vbat = 400
.param RL = Vbat/Idc
.param Rac = 8/pi^2*RL
.param Cs2 = Cs*2
.param Cs = 1/(Ls*(2*pi*fres2)^2)
k1 L5 L6 {kcoup}
.param duration =20m
.param starttran = duration-4m
.param VGA =40
.param kcoup=0.2
.param fres2=85000
.save I(L5) I(L6) v(n05) i(L1) i(R2)
k2 L1 L2 {kcoup}
.param startfreq = 82000
.param stopfreq = 87000
.param stepfreq = 50
.step param fsw list 81750 83000 85000 86400
.end
‘
I want to programmatically replace the .step param line with a new one, as a loop through my code and update some of these parameters. ‘
I can find the index into the char array where ".step param", but I can’t figure out how to convert the characters from .step to the end of that line to a string so I can just replace the whole line with a new one.
Thanks in advance for the help.I’m trying to programmatically update a Qspice netlist. I read the *.net file in using fileread.
netlist = fileread([filepath filename);
the file looks like this:
‘* netlist
L5 N08 0 {Lp} Rser = 0.01 ic=0
L6 0 N07 {Ls} Rser=0.01 ic=0
C3 N06 N08 {Cp}
C4 N07 N09 {Cs}
V2 N06 0 pulse -VGA VGA 0 3n 3n period/2 period ac=1
R1 N09 0 .01
L1 N11 0 {Lp} Rser = 0.01 ic=0
L2 0 N10 {Ls} Rser=0.01 ic=0
C1 N05 N11 {Cp}
C2 N10 N12 {Cs}
V1 N05 0 pulse -VGA VGA 0 3n 3n period/2 period
R2 N12 0 5
.tran 0 {duration} {starttran} 2n
.param fres1=83000
.param period= 1/fsw
.param Cp = 1/(Lp*(2*pi*fres1)^2)
.param Lp= 34µ
.param Ls= 34µ
.param Cp2 = Cp*2
.param Idc = 104.42
.
.param Vbat = 400
.param RL = Vbat/Idc
.param Rac = 8/pi^2*RL
.param Cs2 = Cs*2
.param Cs = 1/(Ls*(2*pi*fres2)^2)
k1 L5 L6 {kcoup}
.param duration =20m
.param starttran = duration-4m
.param VGA =40
.param kcoup=0.2
.param fres2=85000
.save I(L5) I(L6) v(n05) i(L1) i(R2)
k2 L1 L2 {kcoup}
.param startfreq = 82000
.param stopfreq = 87000
.param stepfreq = 50
.step param fsw list 81750 83000 85000 86400
.end
‘
I want to programmatically replace the .step param line with a new one, as a loop through my code and update some of these parameters. ‘
I can find the index into the char array where ".step param", but I can’t figure out how to convert the characters from .step to the end of that line to a string so I can just replace the whole line with a new one.
Thanks in advance for the help. I’m trying to programmatically update a Qspice netlist. I read the *.net file in using fileread.
netlist = fileread([filepath filename);
the file looks like this:
‘* netlist
L5 N08 0 {Lp} Rser = 0.01 ic=0
L6 0 N07 {Ls} Rser=0.01 ic=0
C3 N06 N08 {Cp}
C4 N07 N09 {Cs}
V2 N06 0 pulse -VGA VGA 0 3n 3n period/2 period ac=1
R1 N09 0 .01
L1 N11 0 {Lp} Rser = 0.01 ic=0
L2 0 N10 {Ls} Rser=0.01 ic=0
C1 N05 N11 {Cp}
C2 N10 N12 {Cs}
V1 N05 0 pulse -VGA VGA 0 3n 3n period/2 period
R2 N12 0 5
.tran 0 {duration} {starttran} 2n
.param fres1=83000
.param period= 1/fsw
.param Cp = 1/(Lp*(2*pi*fres1)^2)
.param Lp= 34µ
.param Ls= 34µ
.param Cp2 = Cp*2
.param Idc = 104.42
.
.param Vbat = 400
.param RL = Vbat/Idc
.param Rac = 8/pi^2*RL
.param Cs2 = Cs*2
.param Cs = 1/(Ls*(2*pi*fres2)^2)
k1 L5 L6 {kcoup}
.param duration =20m
.param starttran = duration-4m
.param VGA =40
.param kcoup=0.2
.param fres2=85000
.save I(L5) I(L6) v(n05) i(L1) i(R2)
k2 L1 L2 {kcoup}
.param startfreq = 82000
.param stopfreq = 87000
.param stepfreq = 50
.step param fsw list 81750 83000 85000 86400
.end
‘
I want to programmatically replace the .step param line with a new one, as a loop through my code and update some of these parameters. ‘
I can find the index into the char array where ".step param", but I can’t figure out how to convert the characters from .step to the end of that line to a string so I can just replace the whole line with a new one.
Thanks in advance for the help. char arrays, indexing MATLAB Answers — New Questions