Tag Archives: matlab
Scripts become blank and unviewable on R2022a/b (M1 mac)
I’m regularly experiencing an issue where several minutes after opening and using MATLAB, all tabs (for all other scripts/live scripts) asides from the one that I’ve been actively working on will become completely white and blank. Seemingly nothing will fix the issue except restarting MATLAB which is extremely annoying. The contents don’t seem to be getting affected, it just becomes impossible to work on anything except a single script. Closing and reopening the tabs does nothing and newly created scripts are also unusable. I have seen other posts suggesting that this could be an issue with opengl hardware rendering, however on my computer opengl software rendering doesn’t seem to be supported.
Computer specs:
MacOS Monterey 12.2.1
Macbook air M1 2020
Memory: 16 GB
MATLAB:
R2022b (same issue occurs on R2022a)
64-bit maci64
Please let me know if any other information would be helpful. Thanks!I’m regularly experiencing an issue where several minutes after opening and using MATLAB, all tabs (for all other scripts/live scripts) asides from the one that I’ve been actively working on will become completely white and blank. Seemingly nothing will fix the issue except restarting MATLAB which is extremely annoying. The contents don’t seem to be getting affected, it just becomes impossible to work on anything except a single script. Closing and reopening the tabs does nothing and newly created scripts are also unusable. I have seen other posts suggesting that this could be an issue with opengl hardware rendering, however on my computer opengl software rendering doesn’t seem to be supported.
Computer specs:
MacOS Monterey 12.2.1
Macbook air M1 2020
Memory: 16 GB
MATLAB:
R2022b (same issue occurs on R2022a)
64-bit maci64
Please let me know if any other information would be helpful. Thanks! I’m regularly experiencing an issue where several minutes after opening and using MATLAB, all tabs (for all other scripts/live scripts) asides from the one that I’ve been actively working on will become completely white and blank. Seemingly nothing will fix the issue except restarting MATLAB which is extremely annoying. The contents don’t seem to be getting affected, it just becomes impossible to work on anything except a single script. Closing and reopening the tabs does nothing and newly created scripts are also unusable. I have seen other posts suggesting that this could be an issue with opengl hardware rendering, however on my computer opengl software rendering doesn’t seem to be supported.
Computer specs:
MacOS Monterey 12.2.1
Macbook air M1 2020
Memory: 16 GB
MATLAB:
R2022b (same issue occurs on R2022a)
64-bit maci64
Please let me know if any other information would be helpful. Thanks! mac, matlab gui MATLAB Answers — New Questions
​
I have trouble getting MATLAB to increase altitude or plot tail height upward when I use a positive number. I have to use a negative number. Why? is this???
Code:
pn=0;
pe=0;
pd=0;
phi=0;
theta=0;
psi=0;
handle=[];
%Simulation parameters
dpn=0.5; %Change in position.
dpsi=0.01; %Change in yaw angle.
simlength=150;%Number of Sim Steps
%Draw and update the plane’s position.
for k = 1:simlength
pn = pn+dpn;
pe = pe+dpn;
%THE CODE THAT PRODUCES A PROBLEM IS BELOW
pd = pd – 0.1;
There’s also a problem with the tail fin. I have to designate it as being oriented "downward"…in the negative direction, to produce a vertical tail oriented upward. This is similar to the increment for the vertical height scale above, being increased with a negative number.Code:
pn=0;
pe=0;
pd=0;
phi=0;
theta=0;
psi=0;
handle=[];
%Simulation parameters
dpn=0.5; %Change in position.
dpsi=0.01; %Change in yaw angle.
simlength=150;%Number of Sim Steps
%Draw and update the plane’s position.
for k = 1:simlength
pn = pn+dpn;
pe = pe+dpn;
%THE CODE THAT PRODUCES A PROBLEM IS BELOW
pd = pd – 0.1;
There’s also a problem with the tail fin. I have to designate it as being oriented "downward"…in the negative direction, to produce a vertical tail oriented upward. This is similar to the increment for the vertical height scale above, being increased with a negative number. Code:
pn=0;
pe=0;
pd=0;
phi=0;
theta=0;
psi=0;
handle=[];
%Simulation parameters
dpn=0.5; %Change in position.
dpsi=0.01; %Change in yaw angle.
simlength=150;%Number of Sim Steps
%Draw and update the plane’s position.
for k = 1:simlength
pn = pn+dpn;
pe = pe+dpn;
%THE CODE THAT PRODUCES A PROBLEM IS BELOW
pd = pd – 0.1;
There’s also a problem with the tail fin. I have to designate it as being oriented "downward"…in the negative direction, to produce a vertical tail oriented upward. This is similar to the increment for the vertical height scale above, being increased with a negative number. down is up, why is up negative? MATLAB Answers — New Questions
​
How could I use display function for this?
Hello there, I am using Matlab but it is not my thing at all so I have minimal knowledge about it. I would like to display the result of dt*t but I don’t know how to word it properly on the display function. Can someone help me please?Hello there, I am using Matlab but it is not my thing at all so I have minimal knowledge about it. I would like to display the result of dt*t but I don’t know how to word it properly on the display function. Can someone help me please? Hello there, I am using Matlab but it is not my thing at all so I have minimal knowledge about it. I would like to display the result of dt*t but I don’t know how to word it properly on the display function. Can someone help me please? display MATLAB Answers — New Questions
​
Fuzzy control problem: input 2 expects a value in range [-50 50], but has a value of 1035.94
I got these warning while running my model
Warning:In ‘bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller’, input 2 expects a value in range [-50 50], but has a value of 1035.94.
Warning:In ‘bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller’, no rules fired for Output 1. Defuzzified output value set to its mean range value 0.
I already tried to adjust the input 2 but still got those warnings
Here’s the block :
Here’s the fis file:
[System]
Name=’Ux3_’
Type=’mamdani’
Version=2.0
NumInputs=2
NumOutputs=1
NumRules=49
AndMethod=’min’
OrMethod=’max’
ImpMethod=’min’
AggMethod=’max’
DefuzzMethod=’centroid’
[Input1]
Name=’x’
Range=[-5.5 5.5]
NumMFs=7
MF1=’NH’:’trapmf’,[-6.875 -5.5 -4.95 -3.575]
MF2=’NM’:’trimf’,[-4.675 -3.575 -2.2]
MF3=’NL’:’trimf’,[-3.575 -2.2 -0.825]
MF4=’Z’:’trimf’,[-0.825 0 0.825]
MF5=’PL’:’trimf’,[0.825 2.2 3.575]
MF6=’PM’:’trimf’,[2.2 3.575 4.95]
MF7=’PH’:’trapmf’,[3.575 4.95 6.325 7.7]
[Input2]
Name=’x_derivative’
Range=[-50 50]
NumMFs=7
MF1=’NH’:’trapmf’,[-58.33 -50 -41.67 -33.33]
MF2=’NM’:’trimf’,[-41.67 -33.33 -25]
MF3=’NL’:’trimf’,[-33.33 -20 -8.333]
MF4=’Z’:’trimf’,[-8.333 0 8.333]
MF5=’PL’:’trimf’,[8.333 20 33.33]
MF6=’PM’:’trimf’,[25 33.33 41.67]
MF7=’PH’:’trapmf’,[33.33 41.67 50 58.33]
[Output1]
Name=’output1′
Range=[-2e-06 2e-06]
NumMFs=7
MF1=’NH’:’trapmf’,[-2.7e-06 -2.2e-06 -1.557e-06 -1.057e-06]
MF2=’NM’:’trimf’,[-1.557e-06 -1.057e-06 -5.568e-07]
MF3=’NL’:’trimf’,[-1.057e-06 -5.568e-07 -5.68e-08]
MF4=’Z’:’trimf’,[-1.72e-08 0 3.6e-08]
MF5=’PL’:’trimf’,[9e-08 5.9e-07 1.09e-06]
MF6=’PM’:’trimf’,[5.9e-07 1.09e-06 1.59e-06]
MF7=’PH’:’trapmf’,[1.09e-06 1.59e-06 2.088e-06 2.588e-06]
[Rules]
1 1, 7 (1) : 1
2 1, 7 (1) : 1
3 1, 7 (1) : 1
4 1, 7 (1) : 1
5 1, 6 (1) : 1
6 1, 5 (1) : 1
7 1, 4 (1) : 1
1 2, 7 (1) : 1
2 2, 7 (1) : 1
3 2, 7 (1) : 1
4 2, 6 (1) : 1
5 2, 5 (1) : 1
6 2, 4 (1) : 1
7 2, 3 (1) : 1
1 3, 7 (1) : 1
2 3, 7 (1) : 1
3 3, 6 (1) : 1
4 3, 5 (1) : 1
5 3, 4 (1) : 1
6 3, 3 (1) : 1
7 3, 3 (1) : 1
1 4, 7 (1) : 1
2 4, 6 (1) : 1
3 4, 5 (1) : 1
4 4, 4 (1) : 1
5 4, 3 (1) : 1
6 4, 3 (1) : 1
7 4, 2 (1) : 1
1 5, 6 (1) : 1
2 5, 5 (1) : 1
3 5, 4 (1) : 1
4 5, 3 (1) : 1
5 5, 3 (1) : 1
6 5, 2 (1) : 1
7 5, 2 (1) : 1
1 6, 5 (1) : 1
2 6, 4 (1) : 1
3 6, 3 (1) : 1
4 6, 3 (1) : 1
5 6, 2 (1) : 1
6 6, 2 (1) : 1
7 6, 1 (1) : 1
1 7, 4 (1) : 1
2 7, 3 (1) : 1
3 7, 3 (1) : 1
4 7, 2 (1) : 1
5 7, 1 (1) : 1
6 7, 1 (1) : 1
7 7, 1 (1) : 1I got these warning while running my model
Warning:In ‘bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller’, input 2 expects a value in range [-50 50], but has a value of 1035.94.
Warning:In ‘bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller’, no rules fired for Output 1. Defuzzified output value set to its mean range value 0.
I already tried to adjust the input 2 but still got those warnings
Here’s the block :
Here’s the fis file:
[System]
Name=’Ux3_’
Type=’mamdani’
Version=2.0
NumInputs=2
NumOutputs=1
NumRules=49
AndMethod=’min’
OrMethod=’max’
ImpMethod=’min’
AggMethod=’max’
DefuzzMethod=’centroid’
[Input1]
Name=’x’
Range=[-5.5 5.5]
NumMFs=7
MF1=’NH’:’trapmf’,[-6.875 -5.5 -4.95 -3.575]
MF2=’NM’:’trimf’,[-4.675 -3.575 -2.2]
MF3=’NL’:’trimf’,[-3.575 -2.2 -0.825]
MF4=’Z’:’trimf’,[-0.825 0 0.825]
MF5=’PL’:’trimf’,[0.825 2.2 3.575]
MF6=’PM’:’trimf’,[2.2 3.575 4.95]
MF7=’PH’:’trapmf’,[3.575 4.95 6.325 7.7]
[Input2]
Name=’x_derivative’
Range=[-50 50]
NumMFs=7
MF1=’NH’:’trapmf’,[-58.33 -50 -41.67 -33.33]
MF2=’NM’:’trimf’,[-41.67 -33.33 -25]
MF3=’NL’:’trimf’,[-33.33 -20 -8.333]
MF4=’Z’:’trimf’,[-8.333 0 8.333]
MF5=’PL’:’trimf’,[8.333 20 33.33]
MF6=’PM’:’trimf’,[25 33.33 41.67]
MF7=’PH’:’trapmf’,[33.33 41.67 50 58.33]
[Output1]
Name=’output1′
Range=[-2e-06 2e-06]
NumMFs=7
MF1=’NH’:’trapmf’,[-2.7e-06 -2.2e-06 -1.557e-06 -1.057e-06]
MF2=’NM’:’trimf’,[-1.557e-06 -1.057e-06 -5.568e-07]
MF3=’NL’:’trimf’,[-1.057e-06 -5.568e-07 -5.68e-08]
MF4=’Z’:’trimf’,[-1.72e-08 0 3.6e-08]
MF5=’PL’:’trimf’,[9e-08 5.9e-07 1.09e-06]
MF6=’PM’:’trimf’,[5.9e-07 1.09e-06 1.59e-06]
MF7=’PH’:’trapmf’,[1.09e-06 1.59e-06 2.088e-06 2.588e-06]
[Rules]
1 1, 7 (1) : 1
2 1, 7 (1) : 1
3 1, 7 (1) : 1
4 1, 7 (1) : 1
5 1, 6 (1) : 1
6 1, 5 (1) : 1
7 1, 4 (1) : 1
1 2, 7 (1) : 1
2 2, 7 (1) : 1
3 2, 7 (1) : 1
4 2, 6 (1) : 1
5 2, 5 (1) : 1
6 2, 4 (1) : 1
7 2, 3 (1) : 1
1 3, 7 (1) : 1
2 3, 7 (1) : 1
3 3, 6 (1) : 1
4 3, 5 (1) : 1
5 3, 4 (1) : 1
6 3, 3 (1) : 1
7 3, 3 (1) : 1
1 4, 7 (1) : 1
2 4, 6 (1) : 1
3 4, 5 (1) : 1
4 4, 4 (1) : 1
5 4, 3 (1) : 1
6 4, 3 (1) : 1
7 4, 2 (1) : 1
1 5, 6 (1) : 1
2 5, 5 (1) : 1
3 5, 4 (1) : 1
4 5, 3 (1) : 1
5 5, 3 (1) : 1
6 5, 2 (1) : 1
7 5, 2 (1) : 1
1 6, 5 (1) : 1
2 6, 4 (1) : 1
3 6, 3 (1) : 1
4 6, 3 (1) : 1
5 6, 2 (1) : 1
6 6, 2 (1) : 1
7 6, 1 (1) : 1
1 7, 4 (1) : 1
2 7, 3 (1) : 1
3 7, 3 (1) : 1
4 7, 2 (1) : 1
5 7, 1 (1) : 1
6 7, 1 (1) : 1
7 7, 1 (1) : 1Â I got these warning while running my model
Warning:In ‘bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller’, input 2 expects a value in range [-50 50], but has a value of 1035.94.
Warning:In ‘bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller’, no rules fired for Output 1. Defuzzified output value set to its mean range value 0.
I already tried to adjust the input 2 but still got those warnings
Here’s the block :
Here’s the fis file:
[System]
Name=’Ux3_’
Type=’mamdani’
Version=2.0
NumInputs=2
NumOutputs=1
NumRules=49
AndMethod=’min’
OrMethod=’max’
ImpMethod=’min’
AggMethod=’max’
DefuzzMethod=’centroid’
[Input1]
Name=’x’
Range=[-5.5 5.5]
NumMFs=7
MF1=’NH’:’trapmf’,[-6.875 -5.5 -4.95 -3.575]
MF2=’NM’:’trimf’,[-4.675 -3.575 -2.2]
MF3=’NL’:’trimf’,[-3.575 -2.2 -0.825]
MF4=’Z’:’trimf’,[-0.825 0 0.825]
MF5=’PL’:’trimf’,[0.825 2.2 3.575]
MF6=’PM’:’trimf’,[2.2 3.575 4.95]
MF7=’PH’:’trapmf’,[3.575 4.95 6.325 7.7]
[Input2]
Name=’x_derivative’
Range=[-50 50]
NumMFs=7
MF1=’NH’:’trapmf’,[-58.33 -50 -41.67 -33.33]
MF2=’NM’:’trimf’,[-41.67 -33.33 -25]
MF3=’NL’:’trimf’,[-33.33 -20 -8.333]
MF4=’Z’:’trimf’,[-8.333 0 8.333]
MF5=’PL’:’trimf’,[8.333 20 33.33]
MF6=’PM’:’trimf’,[25 33.33 41.67]
MF7=’PH’:’trapmf’,[33.33 41.67 50 58.33]
[Output1]
Name=’output1′
Range=[-2e-06 2e-06]
NumMFs=7
MF1=’NH’:’trapmf’,[-2.7e-06 -2.2e-06 -1.557e-06 -1.057e-06]
MF2=’NM’:’trimf’,[-1.557e-06 -1.057e-06 -5.568e-07]
MF3=’NL’:’trimf’,[-1.057e-06 -5.568e-07 -5.68e-08]
MF4=’Z’:’trimf’,[-1.72e-08 0 3.6e-08]
MF5=’PL’:’trimf’,[9e-08 5.9e-07 1.09e-06]
MF6=’PM’:’trimf’,[5.9e-07 1.09e-06 1.59e-06]
MF7=’PH’:’trapmf’,[1.09e-06 1.59e-06 2.088e-06 2.588e-06]
[Rules]
1 1, 7 (1) : 1
2 1, 7 (1) : 1
3 1, 7 (1) : 1
4 1, 7 (1) : 1
5 1, 6 (1) : 1
6 1, 5 (1) : 1
7 1, 4 (1) : 1
1 2, 7 (1) : 1
2 2, 7 (1) : 1
3 2, 7 (1) : 1
4 2, 6 (1) : 1
5 2, 5 (1) : 1
6 2, 4 (1) : 1
7 2, 3 (1) : 1
1 3, 7 (1) : 1
2 3, 7 (1) : 1
3 3, 6 (1) : 1
4 3, 5 (1) : 1
5 3, 4 (1) : 1
6 3, 3 (1) : 1
7 3, 3 (1) : 1
1 4, 7 (1) : 1
2 4, 6 (1) : 1
3 4, 5 (1) : 1
4 4, 4 (1) : 1
5 4, 3 (1) : 1
6 4, 3 (1) : 1
7 4, 2 (1) : 1
1 5, 6 (1) : 1
2 5, 5 (1) : 1
3 5, 4 (1) : 1
4 5, 3 (1) : 1
5 5, 3 (1) : 1
6 5, 2 (1) : 1
7 5, 2 (1) : 1
1 6, 5 (1) : 1
2 6, 4 (1) : 1
3 6, 3 (1) : 1
4 6, 3 (1) : 1
5 6, 2 (1) : 1
6 6, 2 (1) : 1
7 6, 1 (1) : 1
1 7, 4 (1) : 1
2 7, 3 (1) : 1
3 7, 3 (1) : 1
4 7, 2 (1) : 1
5 7, 1 (1) : 1
6 7, 1 (1) : 1
7 7, 1 (1) : 1 fuzzy, control, fuzzy logic MATLAB Answers — New Questions
​
Second order non linear differential
I have to solve the following equation: y”(s) + cos(y) = 0
I actually have no idea what function is the correct one in this case or even if MatLab can solve this, do you have any suggestion?I have to solve the following equation: y”(s) + cos(y) = 0
I actually have no idea what function is the correct one in this case or even if MatLab can solve this, do you have any suggestion? I have to solve the following equation: y”(s) + cos(y) = 0
I actually have no idea what function is the correct one in this case or even if MatLab can solve this, do you have any suggestion? mathematics, differential equations, nonlinear, equation MATLAB Answers — New Questions
​
How to get radar measurements instead of only radar detections in drivingRadarDataGenerator?
Hello all,
I’m doing reearch on automative radars and I’m using drivingScenarioDesigner app. It works great but only generates radar detections instead of radar measurements. I’m looking to a way in which I can generate radar measurements (baseband signals) instead of only detections.
My final target is to perform the image synthesis of the radar myself.
Thank you,Hello all,
I’m doing reearch on automative radars and I’m using drivingScenarioDesigner app. It works great but only generates radar detections instead of radar measurements. I’m looking to a way in which I can generate radar measurements (baseband signals) instead of only detections.
My final target is to perform the image synthesis of the radar myself.
Thank you, Hello all,
I’m doing reearch on automative radars and I’m using drivingScenarioDesigner app. It works great but only generates radar detections instead of radar measurements. I’m looking to a way in which I can generate radar measurements (baseband signals) instead of only detections.
My final target is to perform the image synthesis of the radar myself.
Thank you, radar, detections, driving scenario, imaging, automotive radar MATLAB Answers — New Questions
​
How do I use ASIO, ALSA, and other APIs to communicate with PC audio hardware from Simulink?
I want to build my own version of the PortAudio library and use it in place of the PortAudio library that ships with the Signal Processing Blockset, so I can use the API of my choice (ASIO, ALSA, OSS, DirectSound, CoreAudio) to communicate with the audio hardware on my PC from Simulink.I want to build my own version of the PortAudio library and use it in place of the PortAudio library that ships with the Signal Processing Blockset, so I can use the API of my choice (ASIO, ALSA, OSS, DirectSound, CoreAudio) to communicate with the audio hardware on my PC from Simulink. I want to build my own version of the PortAudio library and use it in place of the PortAudio library that ships with the Signal Processing Blockset, so I can use the API of my choice (ASIO, ALSA, OSS, DirectSound, CoreAudio) to communicate with the audio hardware on my PC from Simulink.  MATLAB Answers — New Questions
​
how to choose EMG Windwo size?
ciao,
if i have a emgdata set of length 260001 and fs=1000. i want to analyse the data in small windows,but i am unable to decide how can i choose a window size. I need a scientific calculation to choose a window size. i read somewhere that the signal should be 5 times larger then the choosen window but i need a proper mathematical reasoning.ciao,
if i have a emgdata set of length 260001 and fs=1000. i want to analyse the data in small windows,but i am unable to decide how can i choose a window size. I need a scientific calculation to choose a window size. i read somewhere that the signal should be 5 times larger then the choosen window but i need a proper mathematical reasoning. ciao,
if i have a emgdata set of length 260001 and fs=1000. i want to analyse the data in small windows,but i am unable to decide how can i choose a window size. I need a scientific calculation to choose a window size. i read somewhere that the signal should be 5 times larger then the choosen window but i need a proper mathematical reasoning. window size MATLAB Answers — New Questions
​
Matlab unable to install add-ons
I’m on Arch Linux and when I try to install an add-on on Matlab, I get this error: "Unable to install because you do not have write permissions to this folder: /usr/local/MATLAB/R2024a" How can I solve this?I’m on Arch Linux and when I try to install an add-on on Matlab, I get this error: "Unable to install because you do not have write permissions to this folder: /usr/local/MATLAB/R2024a" How can I solve this? I’m on Arch Linux and when I try to install an add-on on Matlab, I get this error: "Unable to install because you do not have write permissions to this folder: /usr/local/MATLAB/R2024a" How can I solve this? matlab MATLAB Answers — New Questions
​
I have the 3D MTF and i want to convert this 3D MTF to the common 2D MTF as in the image attached. I want to plot MTF vs Spatial frequency graph.
How to convert 3D mtf in to 2D mtf and plot mtf vs Spatial frequency graph.How to convert 3D mtf in to 2D mtf and plot mtf vs Spatial frequency graph. How to convert 3D mtf in to 2D mtf and plot mtf vs Spatial frequency graph. mtf MATLAB Answers — New Questions
​
‘!invalid contrast’ when running contrasts using SPM
Hey all,
I am trying to run a contrast using SPM (SPM12) in order to determine whether brain activation differs between two conditions, using the code snippet below:
%% Contrasts
matlabbatch{3}.spm.stats.con.consess{1}.tcon.name = ‘nav-follow’;
disp(length(names));
disp(size(confounds_matrix,2));
initial_convec = [0 0 -1 0 0 1 0 0 0 0 0 0 0];
num_confounds = size(confounds_matrix, 2);
additional_convec = zeros(1, num_confounds+1);
convec = [initial_convec, additional_convec];
matlabbatch{3}.spm.stats.con.consess{1}.tcon.convec = convec;
matlabbatch{3}.spm.stats.con.consess{1}.tcon.sessrep = ‘replsc’; % ‘none’;
matlabbatch{3}.spm.stats.con.delete = 0;
spm_jobman(‘run’, matlabbatch);
However, I keep getting the error message ‘!invalid contrast’.
Contrasts folder : ./GroupHunt/spm_output/sub-01
0 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <- !invalid contrast
01-Jun-2024 14:03:55 – Failed ‘Contrast Manager’
Error using spm_run_con (line 254)
Error in contrast specification
In file "/mnt/data/fMRI/GroupHunt/spm12/config/spm_run_con.m" (v7738), function "spm_run_con" at line 254.
The following modules did not run:
Failed: Contrast Manager
However, I can’t understand why this contrast is invalid. There are 26 values in the ‘convec’ vector which specifies the contrast and 26 regressors in my design matrix.
The variable ‘convec’ looks as follows:
convec =
Columns 1 through 10
0 0 -1 0 0 1 0 0 0 0
Columns 11 through 20
0 0 0 0 0 0 0 0 0 0
Columns 21 through 26
0 0 0 0 0 0
My design matrix has 26 regressors as follows:
load(fullfile(subdir, ‘SPM.mat’));
numRegressors = size(SPM.xX.X, 2);
disp([‘Number of regressors: ‘, num2str(numRegressors)]);
Number of regressors: 26
I would be so so grateful for a helping hand! :DHey all,
I am trying to run a contrast using SPM (SPM12) in order to determine whether brain activation differs between two conditions, using the code snippet below:
%% Contrasts
matlabbatch{3}.spm.stats.con.consess{1}.tcon.name = ‘nav-follow’;
disp(length(names));
disp(size(confounds_matrix,2));
initial_convec = [0 0 -1 0 0 1 0 0 0 0 0 0 0];
num_confounds = size(confounds_matrix, 2);
additional_convec = zeros(1, num_confounds+1);
convec = [initial_convec, additional_convec];
matlabbatch{3}.spm.stats.con.consess{1}.tcon.convec = convec;
matlabbatch{3}.spm.stats.con.consess{1}.tcon.sessrep = ‘replsc’; % ‘none’;
matlabbatch{3}.spm.stats.con.delete = 0;
spm_jobman(‘run’, matlabbatch);
However, I keep getting the error message ‘!invalid contrast’.
Contrasts folder : ./GroupHunt/spm_output/sub-01
0 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <- !invalid contrast
01-Jun-2024 14:03:55 – Failed ‘Contrast Manager’
Error using spm_run_con (line 254)
Error in contrast specification
In file "/mnt/data/fMRI/GroupHunt/spm12/config/spm_run_con.m" (v7738), function "spm_run_con" at line 254.
The following modules did not run:
Failed: Contrast Manager
However, I can’t understand why this contrast is invalid. There are 26 values in the ‘convec’ vector which specifies the contrast and 26 regressors in my design matrix.
The variable ‘convec’ looks as follows:
convec =
Columns 1 through 10
0 0 -1 0 0 1 0 0 0 0
Columns 11 through 20
0 0 0 0 0 0 0 0 0 0
Columns 21 through 26
0 0 0 0 0 0
My design matrix has 26 regressors as follows:
load(fullfile(subdir, ‘SPM.mat’));
numRegressors = size(SPM.xX.X, 2);
disp([‘Number of regressors: ‘, num2str(numRegressors)]);
Number of regressors: 26
I would be so so grateful for a helping hand! 😀 Hey all,
I am trying to run a contrast using SPM (SPM12) in order to determine whether brain activation differs between two conditions, using the code snippet below:
%% Contrasts
matlabbatch{3}.spm.stats.con.consess{1}.tcon.name = ‘nav-follow’;
disp(length(names));
disp(size(confounds_matrix,2));
initial_convec = [0 0 -1 0 0 1 0 0 0 0 0 0 0];
num_confounds = size(confounds_matrix, 2);
additional_convec = zeros(1, num_confounds+1);
convec = [initial_convec, additional_convec];
matlabbatch{3}.spm.stats.con.consess{1}.tcon.convec = convec;
matlabbatch{3}.spm.stats.con.consess{1}.tcon.sessrep = ‘replsc’; % ‘none’;
matlabbatch{3}.spm.stats.con.delete = 0;
spm_jobman(‘run’, matlabbatch);
However, I keep getting the error message ‘!invalid contrast’.
Contrasts folder : ./GroupHunt/spm_output/sub-01
0 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 <- !invalid contrast
01-Jun-2024 14:03:55 – Failed ‘Contrast Manager’
Error using spm_run_con (line 254)
Error in contrast specification
In file "/mnt/data/fMRI/GroupHunt/spm12/config/spm_run_con.m" (v7738), function "spm_run_con" at line 254.
The following modules did not run:
Failed: Contrast Manager
However, I can’t understand why this contrast is invalid. There are 26 values in the ‘convec’ vector which specifies the contrast and 26 regressors in my design matrix.
The variable ‘convec’ looks as follows:
convec =
Columns 1 through 10
0 0 -1 0 0 1 0 0 0 0
Columns 11 through 20
0 0 0 0 0 0 0 0 0 0
Columns 21 through 26
0 0 0 0 0 0
My design matrix has 26 regressors as follows:
load(fullfile(subdir, ‘SPM.mat’));
numRegressors = size(SPM.xX.X, 2);
disp([‘Number of regressors: ‘, num2str(numRegressors)]);
Number of regressors: 26
I would be so so grateful for a helping hand! 😀 contrasts, spm, matlab, fmri, brain MATLAB Answers — New Questions
​
I can’t get my trial version of Matlab
I can’t get my trial version of MatlabI can’t get my trial version of Matlab I can’t get my trial version of Matlab trial version – unavailable, installation MATLAB Answers — New Questions
​
Why doesn’t Output Maximum work like I expect it to
Hello all,
Sometimes it just feels like MATLAB doesn’t work logically, and I am sure it is because I am failing to grasp some key concept. Everything always just feels way more difficult than I expect it to be. Today there is an issue with Simulink. I have searched on Google for an answer, tried to watch relevant videos and read the help. Still no joy.
I am trying to set the maximum value for a signal so that it doesn’t blow the scaling on my scope plot. I am measuring the Unit Impulse response of a series RLC circuit. As you probably know, the ideal impulse is 0s in duration and infinite amplitude. In reality though, I excite the circuit by summing two step signals, one which steps it up to a high value (e.g. 100) and then the other to pull it down very shortly thereafter.
I then want to find a way to put a max on the signal, so that it only goes to a max of 1, so that it may be represented on the scope as a Unit Impulse, (i.e. Amplitude of 1). I have tried messing with the "Output maximum" field on the "Signal Attributes tab of both the Add block and the Max block, with no success. I don’t understand why putting for example 2 in that field doesn’t cap the signal to a max of 2. What am I missing?Hello all,
Sometimes it just feels like MATLAB doesn’t work logically, and I am sure it is because I am failing to grasp some key concept. Everything always just feels way more difficult than I expect it to be. Today there is an issue with Simulink. I have searched on Google for an answer, tried to watch relevant videos and read the help. Still no joy.
I am trying to set the maximum value for a signal so that it doesn’t blow the scaling on my scope plot. I am measuring the Unit Impulse response of a series RLC circuit. As you probably know, the ideal impulse is 0s in duration and infinite amplitude. In reality though, I excite the circuit by summing two step signals, one which steps it up to a high value (e.g. 100) and then the other to pull it down very shortly thereafter.
I then want to find a way to put a max on the signal, so that it only goes to a max of 1, so that it may be represented on the scope as a Unit Impulse, (i.e. Amplitude of 1). I have tried messing with the "Output maximum" field on the "Signal Attributes tab of both the Add block and the Max block, with no success. I don’t understand why putting for example 2 in that field doesn’t cap the signal to a max of 2. What am I missing? Hello all,
Sometimes it just feels like MATLAB doesn’t work logically, and I am sure it is because I am failing to grasp some key concept. Everything always just feels way more difficult than I expect it to be. Today there is an issue with Simulink. I have searched on Google for an answer, tried to watch relevant videos and read the help. Still no joy.
I am trying to set the maximum value for a signal so that it doesn’t blow the scaling on my scope plot. I am measuring the Unit Impulse response of a series RLC circuit. As you probably know, the ideal impulse is 0s in duration and infinite amplitude. In reality though, I excite the circuit by summing two step signals, one which steps it up to a high value (e.g. 100) and then the other to pull it down very shortly thereafter.
I then want to find a way to put a max on the signal, so that it only goes to a max of 1, so that it may be represented on the scope as a Unit Impulse, (i.e. Amplitude of 1). I have tried messing with the "Output maximum" field on the "Signal Attributes tab of both the Add block and the Max block, with no success. I don’t understand why putting for example 2 in that field doesn’t cap the signal to a max of 2. What am I missing? signal attributes, output maximum MATLAB Answers — New Questions
​
How to combine geoaxes and contourf plot?
I would like to combine geoaxes with satellite view and a contourf plot. For example:
geoaxes(); geolimits([20, 30], [-90, -80]); geobasemap(‘satellite’)
And now, given longitude, latitude and sea surface temperature, plot the sea surface temperature as a contour plot. For instance:
contourf(lon, lat, SST)
But this throws this error:
Error using newplot (line 81)
Adding Cartesian plot to geoaxes is not supported.
Error in contourf (line 75)
cax = newplot(cax);
Trying the corresponding function from the Mapping Toolbox:
contourfm(lon, lat, SST)
Error using hggroup
Group cannot be a child of GeographicAxes.
Error in internal.mapgraph.HGGroupAdapter (line 62)
g = hggroup(‘Parent’,ax);
Error in internal.mapgraph.ContourGroup (line 282)
h = h@internal.mapgraph.HGGroupAdapter(args{:});
Error in internal.mapgraph.GeographicContourGroup (line 55)
h = h@internal.mapgraph.ContourGroup(varargin{:});
Error in contourm (line 111)
h = internal.mapgraph.GeographicContourGroup(ax, Z, R, levelList);
Error in contourfm (line 39)
contourm(varargin{:},’Fill’,’on’,’DefaultLineColor’,’black’);
I am wondering if it is possible to combine the satellite land view offered by geoaxes together with a contour plot of a 2D geographical array. Or perhaps is it possible to get a satellite land view with the Mapping Toolbox and then use contourfm?
Thanks in advanceI would like to combine geoaxes with satellite view and a contourf plot. For example:
geoaxes(); geolimits([20, 30], [-90, -80]); geobasemap(‘satellite’)
And now, given longitude, latitude and sea surface temperature, plot the sea surface temperature as a contour plot. For instance:
contourf(lon, lat, SST)
But this throws this error:
Error using newplot (line 81)
Adding Cartesian plot to geoaxes is not supported.
Error in contourf (line 75)
cax = newplot(cax);
Trying the corresponding function from the Mapping Toolbox:
contourfm(lon, lat, SST)
Error using hggroup
Group cannot be a child of GeographicAxes.
Error in internal.mapgraph.HGGroupAdapter (line 62)
g = hggroup(‘Parent’,ax);
Error in internal.mapgraph.ContourGroup (line 282)
h = h@internal.mapgraph.HGGroupAdapter(args{:});
Error in internal.mapgraph.GeographicContourGroup (line 55)
h = h@internal.mapgraph.ContourGroup(varargin{:});
Error in contourm (line 111)
h = internal.mapgraph.GeographicContourGroup(ax, Z, R, levelList);
Error in contourfm (line 39)
contourm(varargin{:},’Fill’,’on’,’DefaultLineColor’,’black’);
I am wondering if it is possible to combine the satellite land view offered by geoaxes together with a contour plot of a 2D geographical array. Or perhaps is it possible to get a satellite land view with the Mapping Toolbox and then use contourfm?
Thanks in advance I would like to combine geoaxes with satellite view and a contourf plot. For example:
geoaxes(); geolimits([20, 30], [-90, -80]); geobasemap(‘satellite’)
And now, given longitude, latitude and sea surface temperature, plot the sea surface temperature as a contour plot. For instance:
contourf(lon, lat, SST)
But this throws this error:
Error using newplot (line 81)
Adding Cartesian plot to geoaxes is not supported.
Error in contourf (line 75)
cax = newplot(cax);
Trying the corresponding function from the Mapping Toolbox:
contourfm(lon, lat, SST)
Error using hggroup
Group cannot be a child of GeographicAxes.
Error in internal.mapgraph.HGGroupAdapter (line 62)
g = hggroup(‘Parent’,ax);
Error in internal.mapgraph.ContourGroup (line 282)
h = h@internal.mapgraph.HGGroupAdapter(args{:});
Error in internal.mapgraph.GeographicContourGroup (line 55)
h = h@internal.mapgraph.ContourGroup(varargin{:});
Error in contourm (line 111)
h = internal.mapgraph.GeographicContourGroup(ax, Z, R, levelList);
Error in contourfm (line 39)
contourm(varargin{:},’Fill’,’on’,’DefaultLineColor’,’black’);
I am wondering if it is possible to combine the satellite land view offered by geoaxes together with a contour plot of a 2D geographical array. Or perhaps is it possible to get a satellite land view with the Mapping Toolbox and then use contourfm?
Thanks in advance geoaxes, satellite, contourf MATLAB Answers — New Questions
​
Extracting signal phase using MAximum Entropy Method
Dear community,
I have measured the SFG signal as a function of IR frequency (SFG intensity vs Frequency) and saved it in the file "Rehl.txt". The obtained phase for this signal is saved in another file named "MEM_Phi.txt". I am now using the Maximum Entropy Method (MEM) to extract the phase of the SFG signal.
I have written a code in the file "MEM_Phase.m", but the problem is that the calculated MEM phase is different from the actual phase provided in "MEM_Phi.txt". I would greatly appreciate any help in resolving this issue.
I have also attached a paper that contains the relevant equations. In equation 14 of the paper, P(v) represents the SFG intensity that we have already measured. The unknowns in equation 14 are the values of "beta" and "a_k". By obtaining the values of "a_k", we can calculate the denominator of equation 14, which is a complex value. The MEM phase will then be the phase of these complex values.
Thank you for your assistance.Dear community,
I have measured the SFG signal as a function of IR frequency (SFG intensity vs Frequency) and saved it in the file "Rehl.txt". The obtained phase for this signal is saved in another file named "MEM_Phi.txt". I am now using the Maximum Entropy Method (MEM) to extract the phase of the SFG signal.
I have written a code in the file "MEM_Phase.m", but the problem is that the calculated MEM phase is different from the actual phase provided in "MEM_Phi.txt". I would greatly appreciate any help in resolving this issue.
I have also attached a paper that contains the relevant equations. In equation 14 of the paper, P(v) represents the SFG intensity that we have already measured. The unknowns in equation 14 are the values of "beta" and "a_k". By obtaining the values of "a_k", we can calculate the denominator of equation 14, which is a complex value. The MEM phase will then be the phase of these complex values.
Thank you for your assistance. Dear community,
I have measured the SFG signal as a function of IR frequency (SFG intensity vs Frequency) and saved it in the file "Rehl.txt". The obtained phase for this signal is saved in another file named "MEM_Phi.txt". I am now using the Maximum Entropy Method (MEM) to extract the phase of the SFG signal.
I have written a code in the file "MEM_Phase.m", but the problem is that the calculated MEM phase is different from the actual phase provided in "MEM_Phi.txt". I would greatly appreciate any help in resolving this issue.
I have also attached a paper that contains the relevant equations. In equation 14 of the paper, P(v) represents the SFG intensity that we have already measured. The unknowns in equation 14 are the values of "beta" and "a_k". By obtaining the values of "a_k", we can calculate the denominator of equation 14, which is a complex value. The MEM phase will then be the phase of these complex values.
Thank you for your assistance. phase, sfg, signal, mem MATLAB Answers — New Questions
​
How can I read CDF file?
Dear All,
I have a data with the following format"SW_OPER_TECATMS_2F_20131126T000000_20131126T235959_0401.cdf". How can I read it and extract the relevant dat afrom it such as STEC and VTEC?
Best,
AraDear All,
I have a data with the following format"SW_OPER_TECATMS_2F_20131126T000000_20131126T235959_0401.cdf". How can I read it and extract the relevant dat afrom it such as STEC and VTEC?
Best,
Ara Dear All,
I have a data with the following format"SW_OPER_TECATMS_2F_20131126T000000_20131126T235959_0401.cdf". How can I read it and extract the relevant dat afrom it such as STEC and VTEC?
Best,
Ara cdf files MATLAB Answers — New Questions
​
Help! I’m having difficulty uploading files from my computer to the Matlab Online
Hello,
I am using MATLAB online for the first time. Unlike the versions that I have used before, my data files do not seem to be stored on the online platform, which means that I have to upload them directly from my computer (rather than the shared space on MATLAB online).
How do I go about this? So far using the command line options e.g. load(C:Users…etc) does not work. The error message is:
Error using load
Unable to read file <pathnamefilename>
Can someone please help me? Thank youHello,
I am using MATLAB online for the first time. Unlike the versions that I have used before, my data files do not seem to be stored on the online platform, which means that I have to upload them directly from my computer (rather than the shared space on MATLAB online).
How do I go about this? So far using the command line options e.g. load(C:Users…etc) does not work. The error message is:
Error using load
Unable to read file <pathnamefilename>
Can someone please help me? Thank you Hello,
I am using MATLAB online for the first time. Unlike the versions that I have used before, my data files do not seem to be stored on the online platform, which means that I have to upload them directly from my computer (rather than the shared space on MATLAB online).
How do I go about this? So far using the command line options e.g. load(C:Users…etc) does not work. The error message is:
Error using load
Unable to read file <pathnamefilename>
Can someone please help me? Thank you upload, file, spreadsheet MATLAB Answers — New Questions
​
Why does MATLAB Online behave so slowly, and even get stuck on the loading page?
I have been using MATLAB online for several days to work on a project remotely. The most recent time I ran my code, I forgot to suppress the output of a loop that cycles through a cell array, causing a large amount of text to try to display in the command window. I used ctrl+c to kill the program, but the webpage became unresponsive. Now, when I try to load MATLAB Online, I get a message that I have a session active, which asks me to log out of that session and start a new one. The page then gets stuck at its initial loading animation. I have let the page attempt to load for over an hour, with no change.
Related to this, MATLAB Online behaves very slowly, even when typing on the Command Window.
I have also tried clearing my cookies and using a different browser.
 I have been using MATLAB online for several days to work on a project remotely. The most recent time I ran my code, I forgot to suppress the output of a loop that cycles through a cell array, causing a large amount of text to try to display in the command window. I used ctrl+c to kill the program, but the webpage became unresponsive. Now, when I try to load MATLAB Online, I get a message that I have a session active, which asks me to log out of that session and start a new one. The page then gets stuck at its initial loading animation. I have let the page attempt to load for over an hour, with no change.
Related to this, MATLAB Online behaves very slowly, even when typing on the Command Window.
I have also tried clearing my cookies and using a different browser.
  I have been using MATLAB online for several days to work on a project remotely. The most recent time I ran my code, I forgot to suppress the output of a loop that cycles through a cell array, causing a large amount of text to try to display in the command window. I used ctrl+c to kill the program, but the webpage became unresponsive. Now, when I try to load MATLAB Online, I get a message that I have a session active, which asks me to log out of that session and start a new one. The page then gets stuck at its initial loading animation. I have let the page attempt to load for over an hour, with no change.
Related to this, MATLAB Online behaves very slowly, even when typing on the Command Window.
I have also tried clearing my cookies and using a different browser.
  matlab, online, rmdir, login, loading, ctrl+c, print, output, slow, time MATLAB Answers — New Questions
​
interpolate value of 3D points on a meshgrid with a CUSTOM FUNCTION
% particle to mesh interpolation function (NOT ARBITRARY)
H = 3/pi/rCut^2;
u = @(r) H*(1-r/rCut).*(r.^2<=rCut^2);
for k = 1:length(ptcls.q)
r = sqrt((X – ptcls.x(1, k)).^2 + (Y – ptcls.x(2, k)).^2 + (Z – ptcls.x(3, k)).^2);
rho_lr = rho_lr + ptcls.q(k)*u(r);
end
I want to speed up this simple loop where ptcls.q is the value I want to interpolate, X,Y,Z are the points of a meshgrid and ptcls.x is the 3D scattered position of particles inside the mesh. I cannot use scatteredInterpolant function since is slow and does not fit the math behind the problem, any idea on how to speed up the calculation?% particle to mesh interpolation function (NOT ARBITRARY)
H = 3/pi/rCut^2;
u = @(r) H*(1-r/rCut).*(r.^2<=rCut^2);
for k = 1:length(ptcls.q)
r = sqrt((X – ptcls.x(1, k)).^2 + (Y – ptcls.x(2, k)).^2 + (Z – ptcls.x(3, k)).^2);
rho_lr = rho_lr + ptcls.q(k)*u(r);
end
I want to speed up this simple loop where ptcls.q is the value I want to interpolate, X,Y,Z are the points of a meshgrid and ptcls.x is the 3D scattered position of particles inside the mesh. I cannot use scatteredInterpolant function since is slow and does not fit the math behind the problem, any idea on how to speed up the calculation? % particle to mesh interpolation function (NOT ARBITRARY)
H = 3/pi/rCut^2;
u = @(r) H*(1-r/rCut).*(r.^2<=rCut^2);
for k = 1:length(ptcls.q)
r = sqrt((X – ptcls.x(1, k)).^2 + (Y – ptcls.x(2, k)).^2 + (Z – ptcls.x(3, k)).^2);
rho_lr = rho_lr + ptcls.q(k)*u(r);
end
I want to speed up this simple loop where ptcls.q is the value I want to interpolate, X,Y,Z are the points of a meshgrid and ptcls.x is the 3D scattered position of particles inside the mesh. I cannot use scatteredInterpolant function since is slow and does not fit the math behind the problem, any idea on how to speed up the calculation? interpolation, scattered points, meshgrid MATLAB Answers — New Questions
​
Using matlab in snaptostamps image processing
I am encoutering this issue which wasn’t happening in older releases, the program cannot plot georeferenced images from the selected data folder due to the following errorI am encoutering this issue which wasn’t happening in older releases, the program cannot plot georeferenced images from the selected data folder due to the following error I am encoutering this issue which wasn’t happening in older releases, the program cannot plot georeferenced images from the selected data folder due to the following error arrays, plotting MATLAB Answers — New Questions
​