Tag Archives: matlab
Brace indexing is not supported for variables of this type.
Dear Matlab communities:
I am running a spm script for analyizing neuroimaging data, the first script here (ModelSpecificationBinaryMask.m) is to loop another job file ModelSpecificationBinaryMask_job.m over the two subjects while assigning the regressor files that correspond to each of the runs for one subject.
However, I am seeing the follwing errors:
Brace indexing is not supported for variables of this type.
Error in spm_jobman>canonicalise_jobs (line 415)
comp(i) = comp(i) && any(strcmp(fieldnames(job{i}{j}), …
Error in spm_jobman (line 152)
mljob = canonicalise_jobs(jobs);
Error in ModelSpecificationBinaryMask (line 50)
spm_jobman(‘run’, jobs, inputs);
ModelSpecificationBinaryMask.m
clear
close all
clc
% Created by GB on 9/9/19.
% Edited by LC on 8/19/24.
for sub = [101,102]
jobfile = {‘/Volumes/PUMPKIN/scripts/GabbyScripts/ModelSpecificationBinaryMaskTHRESHOFF_job.m’};
nrun = 1; % Assuming nrun should be 1 since we are processing one subject at a time
ncue = 8; % 8 runs for cue task
jobs = repmat(jobfile, 1, nrun);
inputs = cell(25, 1); % Initialize cell array for inputs (25 because you have 3 inputs per run and 8 runs)
% Create a homepath, a base location of all the data
homepath = ‘/Volumes/PUMPKIN/Preprocessed/groupA/Volumes’;
evpath = ‘/Volumes/PUMPKIN/Regressors’;
for n = 1:nrun
sub_path = fullfile(‘/Volumes/PUMPKIN/halfpipeXspm/sub-‘, num2str(sub(n)), ‘/1stLevel’);
%mkdir(sub_path);
inputs{1, n} = {sub_path}; % fMRI model specification: Directory – cfg_files
% Loop through each run for the subject
for run = 1:ncue
run_dir = fullfile(homepath, strcat(‘sub_’, num2str(sub(n))), ‘-‘, num2str(run));
% List all ‘vol_*.nii’ files in the current folder
files = dir(fullfile(run_dir, ‘vol_*.nii’));
if ~isempty(files)
% Now assign images
inputs{2+(run-1)*3, n} = {fullfile(run_dir, {files.name})}; % fMRI model specification: Scans – cfg_files
% Insert multiple condition files (i.e., evs)
ev_file = dir(fullfile(evpath, strcat(‘sub’, num2str(sub(n)), ‘run’, num2str(run), ‘_exev_CS_faceCue.mat’)));
inputs{3+(run-1)*3, n} = {fullfile(evpath, ev_file.name)};
% Insert multiple regressors (6 rigid body motion parameters)
rp_file = dir(fullfile(run_dir, ‘rp_af*.txt’));
inputs{4+(run-1)*3, n} = {fullfile(run_dir, rp_file.name)};
end
clear files rp_file
end
clear currfold
end
% Run the job using SPM
spm_jobman(‘run’, jobs, inputs);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% ModelSpecificationBinaryMask_job.m
%———————————————————————–
% Job saved on 17-Jun-2016 14:21:03 by cfg_util (rev $Rev: 6134 $)
% spm SPM – SPM12 (6225)
% cfg_basicio BasicIO – Unknown
%———————————————————————–
disp(‘Script is running’);
matlabbatch(1).spm.stats.fmri_spec.dir = {‘/Volumes/PUMPKIN/halfpipeXspm/sub-*/1stLevel’};
matlabbatch(1).spm.stats.fmri_spec.timing.units = ‘secs’;
matlabbatch(1).spm.stats.fmri_spec.timing.RT = 2;
matlabbatch(1).spm.stats.fmri_spec.timing.fmri_t = 32;
matlabbatch(1).spm.stats.fmri_spec.timing.fmri_t0 = 1;
matlabbatch(1).spm.stats.fmri_spec.sess(1).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(1).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(1).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(2).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(2).multi ='<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(2).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(3).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(3).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(3).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(4).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(4).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(4).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(5).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(5).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(5).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(6).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(6).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(6).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(7).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(7).multi ='<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(7).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(8).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(8).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(8).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.fact = struct(‘name’, {}, ‘levels’, {});
matlabbatch(1).spm.stats.fmri_spec.bases.hrf.derivs = [0 0];
matlabbatch(1).spm.stats.fmri_spec.volt = 1;
matlabbatch(1).spm.stats.fmri_spec.global = ‘None’;
matlabbatch(1).spm.stats.fmri_spec.mthresh = 0.0; %no voxels are thresholded so all voxels are being used%
matlabbatch(1).spm.stats.fmri_spec.mask = {‘/Volumes/PUMPKIN/scripts/LancyScripts/peripheral/C1-101-117/binarygreymattermask.nii’};
matlabbatch(1).spm.stats.fmri_spec.cvi = ‘AR(1)’;
disp(‘Script completed’);Dear Matlab communities:
I am running a spm script for analyizing neuroimaging data, the first script here (ModelSpecificationBinaryMask.m) is to loop another job file ModelSpecificationBinaryMask_job.m over the two subjects while assigning the regressor files that correspond to each of the runs for one subject.
However, I am seeing the follwing errors:
Brace indexing is not supported for variables of this type.
Error in spm_jobman>canonicalise_jobs (line 415)
comp(i) = comp(i) && any(strcmp(fieldnames(job{i}{j}), …
Error in spm_jobman (line 152)
mljob = canonicalise_jobs(jobs);
Error in ModelSpecificationBinaryMask (line 50)
spm_jobman(‘run’, jobs, inputs);
ModelSpecificationBinaryMask.m
clear
close all
clc
% Created by GB on 9/9/19.
% Edited by LC on 8/19/24.
for sub = [101,102]
jobfile = {‘/Volumes/PUMPKIN/scripts/GabbyScripts/ModelSpecificationBinaryMaskTHRESHOFF_job.m’};
nrun = 1; % Assuming nrun should be 1 since we are processing one subject at a time
ncue = 8; % 8 runs for cue task
jobs = repmat(jobfile, 1, nrun);
inputs = cell(25, 1); % Initialize cell array for inputs (25 because you have 3 inputs per run and 8 runs)
% Create a homepath, a base location of all the data
homepath = ‘/Volumes/PUMPKIN/Preprocessed/groupA/Volumes’;
evpath = ‘/Volumes/PUMPKIN/Regressors’;
for n = 1:nrun
sub_path = fullfile(‘/Volumes/PUMPKIN/halfpipeXspm/sub-‘, num2str(sub(n)), ‘/1stLevel’);
%mkdir(sub_path);
inputs{1, n} = {sub_path}; % fMRI model specification: Directory – cfg_files
% Loop through each run for the subject
for run = 1:ncue
run_dir = fullfile(homepath, strcat(‘sub_’, num2str(sub(n))), ‘-‘, num2str(run));
% List all ‘vol_*.nii’ files in the current folder
files = dir(fullfile(run_dir, ‘vol_*.nii’));
if ~isempty(files)
% Now assign images
inputs{2+(run-1)*3, n} = {fullfile(run_dir, {files.name})}; % fMRI model specification: Scans – cfg_files
% Insert multiple condition files (i.e., evs)
ev_file = dir(fullfile(evpath, strcat(‘sub’, num2str(sub(n)), ‘run’, num2str(run), ‘_exev_CS_faceCue.mat’)));
inputs{3+(run-1)*3, n} = {fullfile(evpath, ev_file.name)};
% Insert multiple regressors (6 rigid body motion parameters)
rp_file = dir(fullfile(run_dir, ‘rp_af*.txt’));
inputs{4+(run-1)*3, n} = {fullfile(run_dir, rp_file.name)};
end
clear files rp_file
end
clear currfold
end
% Run the job using SPM
spm_jobman(‘run’, jobs, inputs);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% ModelSpecificationBinaryMask_job.m
%———————————————————————–
% Job saved on 17-Jun-2016 14:21:03 by cfg_util (rev $Rev: 6134 $)
% spm SPM – SPM12 (6225)
% cfg_basicio BasicIO – Unknown
%———————————————————————–
disp(‘Script is running’);
matlabbatch(1).spm.stats.fmri_spec.dir = {‘/Volumes/PUMPKIN/halfpipeXspm/sub-*/1stLevel’};
matlabbatch(1).spm.stats.fmri_spec.timing.units = ‘secs’;
matlabbatch(1).spm.stats.fmri_spec.timing.RT = 2;
matlabbatch(1).spm.stats.fmri_spec.timing.fmri_t = 32;
matlabbatch(1).spm.stats.fmri_spec.timing.fmri_t0 = 1;
matlabbatch(1).spm.stats.fmri_spec.sess(1).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(1).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(1).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(2).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(2).multi ='<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(2).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(3).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(3).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(3).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(4).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(4).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(4).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(5).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(5).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(5).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(6).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(6).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(6).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(7).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(7).multi ='<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(7).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(8).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(8).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(8).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.fact = struct(‘name’, {}, ‘levels’, {});
matlabbatch(1).spm.stats.fmri_spec.bases.hrf.derivs = [0 0];
matlabbatch(1).spm.stats.fmri_spec.volt = 1;
matlabbatch(1).spm.stats.fmri_spec.global = ‘None’;
matlabbatch(1).spm.stats.fmri_spec.mthresh = 0.0; %no voxels are thresholded so all voxels are being used%
matlabbatch(1).spm.stats.fmri_spec.mask = {‘/Volumes/PUMPKIN/scripts/LancyScripts/peripheral/C1-101-117/binarygreymattermask.nii’};
matlabbatch(1).spm.stats.fmri_spec.cvi = ‘AR(1)’;
disp(‘Script completed’); Dear Matlab communities:
I am running a spm script for analyizing neuroimaging data, the first script here (ModelSpecificationBinaryMask.m) is to loop another job file ModelSpecificationBinaryMask_job.m over the two subjects while assigning the regressor files that correspond to each of the runs for one subject.
However, I am seeing the follwing errors:
Brace indexing is not supported for variables of this type.
Error in spm_jobman>canonicalise_jobs (line 415)
comp(i) = comp(i) && any(strcmp(fieldnames(job{i}{j}), …
Error in spm_jobman (line 152)
mljob = canonicalise_jobs(jobs);
Error in ModelSpecificationBinaryMask (line 50)
spm_jobman(‘run’, jobs, inputs);
ModelSpecificationBinaryMask.m
clear
close all
clc
% Created by GB on 9/9/19.
% Edited by LC on 8/19/24.
for sub = [101,102]
jobfile = {‘/Volumes/PUMPKIN/scripts/GabbyScripts/ModelSpecificationBinaryMaskTHRESHOFF_job.m’};
nrun = 1; % Assuming nrun should be 1 since we are processing one subject at a time
ncue = 8; % 8 runs for cue task
jobs = repmat(jobfile, 1, nrun);
inputs = cell(25, 1); % Initialize cell array for inputs (25 because you have 3 inputs per run and 8 runs)
% Create a homepath, a base location of all the data
homepath = ‘/Volumes/PUMPKIN/Preprocessed/groupA/Volumes’;
evpath = ‘/Volumes/PUMPKIN/Regressors’;
for n = 1:nrun
sub_path = fullfile(‘/Volumes/PUMPKIN/halfpipeXspm/sub-‘, num2str(sub(n)), ‘/1stLevel’);
%mkdir(sub_path);
inputs{1, n} = {sub_path}; % fMRI model specification: Directory – cfg_files
% Loop through each run for the subject
for run = 1:ncue
run_dir = fullfile(homepath, strcat(‘sub_’, num2str(sub(n))), ‘-‘, num2str(run));
% List all ‘vol_*.nii’ files in the current folder
files = dir(fullfile(run_dir, ‘vol_*.nii’));
if ~isempty(files)
% Now assign images
inputs{2+(run-1)*3, n} = {fullfile(run_dir, {files.name})}; % fMRI model specification: Scans – cfg_files
% Insert multiple condition files (i.e., evs)
ev_file = dir(fullfile(evpath, strcat(‘sub’, num2str(sub(n)), ‘run’, num2str(run), ‘_exev_CS_faceCue.mat’)));
inputs{3+(run-1)*3, n} = {fullfile(evpath, ev_file.name)};
% Insert multiple regressors (6 rigid body motion parameters)
rp_file = dir(fullfile(run_dir, ‘rp_af*.txt’));
inputs{4+(run-1)*3, n} = {fullfile(run_dir, rp_file.name)};
end
clear files rp_file
end
clear currfold
end
% Run the job using SPM
spm_jobman(‘run’, jobs, inputs);
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% ModelSpecificationBinaryMask_job.m
%———————————————————————–
% Job saved on 17-Jun-2016 14:21:03 by cfg_util (rev $Rev: 6134 $)
% spm SPM – SPM12 (6225)
% cfg_basicio BasicIO – Unknown
%———————————————————————–
disp(‘Script is running’);
matlabbatch(1).spm.stats.fmri_spec.dir = {‘/Volumes/PUMPKIN/halfpipeXspm/sub-*/1stLevel’};
matlabbatch(1).spm.stats.fmri_spec.timing.units = ‘secs’;
matlabbatch(1).spm.stats.fmri_spec.timing.RT = 2;
matlabbatch(1).spm.stats.fmri_spec.timing.fmri_t = 32;
matlabbatch(1).spm.stats.fmri_spec.timing.fmri_t0 = 1;
matlabbatch(1).spm.stats.fmri_spec.sess(1).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(1).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(1).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(1).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(2).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(2).multi ='<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(2).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(2).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(3).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(3).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(3).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(3).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(4).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(4).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(4).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(4).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(5).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(5).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(5).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(5).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(6).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(6).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(6).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(6).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(7).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(7).multi ='<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(7).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(7).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.sess(8).scans = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).cond = struct(‘name’, {}, ‘onset’, {}, ‘duration’, {}, ‘tmod’, {}, ‘pmod’, {}, ‘orth’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(8).multi = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).regress = struct(‘name’, {}, ‘val’, {});
matlabbatch(1).spm.stats.fmri_spec.sess(8).multi_reg = ‘<UNDEFINED>’;
matlabbatch(1).spm.stats.fmri_spec.sess(8).hpf = 128;
matlabbatch(1).spm.stats.fmri_spec.fact = struct(‘name’, {}, ‘levels’, {});
matlabbatch(1).spm.stats.fmri_spec.bases.hrf.derivs = [0 0];
matlabbatch(1).spm.stats.fmri_spec.volt = 1;
matlabbatch(1).spm.stats.fmri_spec.global = ‘None’;
matlabbatch(1).spm.stats.fmri_spec.mthresh = 0.0; %no voxels are thresholded so all voxels are being used%
matlabbatch(1).spm.stats.fmri_spec.mask = {‘/Volumes/PUMPKIN/scripts/LancyScripts/peripheral/C1-101-117/binarygreymattermask.nii’};
matlabbatch(1).spm.stats.fmri_spec.cvi = ‘AR(1)’;
disp(‘Script completed’); spm, image processing, error MATLAB Answers — New Questions
Is there an “inverse” of decsg?
Is there a function that is like the invese of decsg? By that I mean: dl = decsg(gd) takes a geometry description matrix gd and returns a decomposed geometry description matrix dl. But what I need is the opposite: Given dl I need to "reconstitute" gd.Is there a function that is like the invese of decsg? By that I mean: dl = decsg(gd) takes a geometry description matrix gd and returns a decomposed geometry description matrix dl. But what I need is the opposite: Given dl I need to "reconstitute" gd. Is there a function that is like the invese of decsg? By that I mean: dl = decsg(gd) takes a geometry description matrix gd and returns a decomposed geometry description matrix dl. But what I need is the opposite: Given dl I need to "reconstitute" gd. decsg, geometry, pde toolbox MATLAB Answers — New Questions
VariSpec software in conjunction with MATLAB
I’m currently trying to use a laser alongside a VariSpec Liquid Crystal Tunable Filter (LCTF) for fluorescent imaging microscopy. Long story short, the software that goes with the microscope is Micro-Manager and the software for the LCTF is VSGUI (or VariSpecGUI).
I want to write code that will effectively carry out a sequence of events on the VSGUI and MM software for me using MATLAB, automatically. From what I’ve read, this is fairly straightforward to do for the Micro-Manager software as there’s some pre-written .m files / script that can be used for the operation of MM and if push comes to shove there is also the Microscopy Toolbox. However, with the VariSpec VSGUI software, I’m struggling to find any files relating to it. I know they exist because the manual for the LCTF states "CRi provides a set of MATLAB files to control VariSpec filters. There is a core support .DLL file and a series of .m files"
So great, the files exist and I don’t need to start from scratch, however, this CRi company does not seem to exist (think it might have been bought over?) and there are no websites that I can find with the files.
Long shot, but does anyone have any of the files that I’m talking about to operate the VariSpec filters?
I don’t think I’m fully capable of writing out a full script from scratch.I’m currently trying to use a laser alongside a VariSpec Liquid Crystal Tunable Filter (LCTF) for fluorescent imaging microscopy. Long story short, the software that goes with the microscope is Micro-Manager and the software for the LCTF is VSGUI (or VariSpecGUI).
I want to write code that will effectively carry out a sequence of events on the VSGUI and MM software for me using MATLAB, automatically. From what I’ve read, this is fairly straightforward to do for the Micro-Manager software as there’s some pre-written .m files / script that can be used for the operation of MM and if push comes to shove there is also the Microscopy Toolbox. However, with the VariSpec VSGUI software, I’m struggling to find any files relating to it. I know they exist because the manual for the LCTF states "CRi provides a set of MATLAB files to control VariSpec filters. There is a core support .DLL file and a series of .m files"
So great, the files exist and I don’t need to start from scratch, however, this CRi company does not seem to exist (think it might have been bought over?) and there are no websites that I can find with the files.
Long shot, but does anyone have any of the files that I’m talking about to operate the VariSpec filters?
I don’t think I’m fully capable of writing out a full script from scratch. I’m currently trying to use a laser alongside a VariSpec Liquid Crystal Tunable Filter (LCTF) for fluorescent imaging microscopy. Long story short, the software that goes with the microscope is Micro-Manager and the software for the LCTF is VSGUI (or VariSpecGUI).
I want to write code that will effectively carry out a sequence of events on the VSGUI and MM software for me using MATLAB, automatically. From what I’ve read, this is fairly straightforward to do for the Micro-Manager software as there’s some pre-written .m files / script that can be used for the operation of MM and if push comes to shove there is also the Microscopy Toolbox. However, with the VariSpec VSGUI software, I’m struggling to find any files relating to it. I know they exist because the manual for the LCTF states "CRi provides a set of MATLAB files to control VariSpec filters. There is a core support .DLL file and a series of .m files"
So great, the files exist and I don’t need to start from scratch, however, this CRi company does not seem to exist (think it might have been bought over?) and there are no websites that I can find with the files.
Long shot, but does anyone have any of the files that I’m talking about to operate the VariSpec filters?
I don’t think I’m fully capable of writing out a full script from scratch. varispec, .m files, vsgui, lctf, software MATLAB Answers — New Questions
R2018b does not complete initialisation
I have been using R2018b successfully for some time, but a few days ago it stopped working.
When I launch Matlab now it remains in the ‘Initialising’ state until I close it down. I cannot navigate to a folder or open the project or model.
I also have R2020b installed and that is still working ok.
There are no errors or warnings displayed.
I checked all the things mentioned in other similar discussions – license is ok, the preferences are not corrupted, the R2XXXx folder is not corrupted, stopping virus protection makes no difference.
I executed the command "matlab -timing" and the timing log contains this:
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
=========================================================
0.00 0.00 0.00 MATLAB script
0.13 0.13 0.00 main
1.11 0.99 -0.00 Session Initialize
1.26 0.00 0.15 Toolbox cache load Start
1.30 0.05 0.00 LM Startup
1.58 0.01 0.27 splash
2.34 0.18 0.58 Constant Initialization
2.36 0.78 0.00 Engine Startup
2.58 0.22 0.00 InitSunVM
6.27 3.55 0.15 PostVMInit
6.28 3.92 0.00 mljInit
6.75 0.47 0.00 StartDesktop
6.75 4.39 0.00 Java initialization
6.89 0.01 0.13 psParser
9.18 2.43 6.75 Init Desktop
Any help would be much appreciated.I have been using R2018b successfully for some time, but a few days ago it stopped working.
When I launch Matlab now it remains in the ‘Initialising’ state until I close it down. I cannot navigate to a folder or open the project or model.
I also have R2020b installed and that is still working ok.
There are no errors or warnings displayed.
I checked all the things mentioned in other similar discussions – license is ok, the preferences are not corrupted, the R2XXXx folder is not corrupted, stopping virus protection makes no difference.
I executed the command "matlab -timing" and the timing log contains this:
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
=========================================================
0.00 0.00 0.00 MATLAB script
0.13 0.13 0.00 main
1.11 0.99 -0.00 Session Initialize
1.26 0.00 0.15 Toolbox cache load Start
1.30 0.05 0.00 LM Startup
1.58 0.01 0.27 splash
2.34 0.18 0.58 Constant Initialization
2.36 0.78 0.00 Engine Startup
2.58 0.22 0.00 InitSunVM
6.27 3.55 0.15 PostVMInit
6.28 3.92 0.00 mljInit
6.75 0.47 0.00 StartDesktop
6.75 4.39 0.00 Java initialization
6.89 0.01 0.13 psParser
9.18 2.43 6.75 Init Desktop
Any help would be much appreciated. I have been using R2018b successfully for some time, but a few days ago it stopped working.
When I launch Matlab now it remains in the ‘Initialising’ state until I close it down. I cannot navigate to a folder or open the project or model.
I also have R2020b installed and that is still working ok.
There are no errors or warnings displayed.
I checked all the things mentioned in other similar discussions – license is ok, the preferences are not corrupted, the R2XXXx folder is not corrupted, stopping virus protection makes no difference.
I executed the command "matlab -timing" and the timing log contains this:
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
=========================================================
0.00 0.00 0.00 MATLAB script
0.13 0.13 0.00 main
1.11 0.99 -0.00 Session Initialize
1.26 0.00 0.15 Toolbox cache load Start
1.30 0.05 0.00 LM Startup
1.58 0.01 0.27 splash
2.34 0.18 0.58 Constant Initialization
2.36 0.78 0.00 Engine Startup
2.58 0.22 0.00 InitSunVM
6.27 3.55 0.15 PostVMInit
6.28 3.92 0.00 mljInit
6.75 0.47 0.00 StartDesktop
6.75 4.39 0.00 Java initialization
6.89 0.01 0.13 psParser
9.18 2.43 6.75 Init Desktop
Any help would be much appreciated. r2018b, startup MATLAB Answers — New Questions
Find strings within other strings then pull data from that point
dear collegaes, please let me ask your help to find a solution for my data analisys.
I have a P0300.txt file that contains a long strip.
here is a portion of P0300.txt:
59 04 03 01 00 65 01 3E 51 09 00 00 51 1C 00 E1
I need to find sets of data, sets could be 2 or 4 digits.
lets say I need to find 01 3E
DATA = regexp(fileread(‘P0300.txt’), ‘r?n’, ‘split’)’;
>> A = string(DATA);
>> B = strfind(A,’01 3E’);
B gives me the position where 01 3E is, in this case B = 19
after this I need to extract the 6 digits on the rigth 51 09 00 <– this values can change depend on test conditions
Any idea on how can I do that?
your feedback will be highly appreciateddear collegaes, please let me ask your help to find a solution for my data analisys.
I have a P0300.txt file that contains a long strip.
here is a portion of P0300.txt:
59 04 03 01 00 65 01 3E 51 09 00 00 51 1C 00 E1
I need to find sets of data, sets could be 2 or 4 digits.
lets say I need to find 01 3E
DATA = regexp(fileread(‘P0300.txt’), ‘r?n’, ‘split’)’;
>> A = string(DATA);
>> B = strfind(A,’01 3E’);
B gives me the position where 01 3E is, in this case B = 19
after this I need to extract the 6 digits on the rigth 51 09 00 <– this values can change depend on test conditions
Any idea on how can I do that?
your feedback will be highly appreciated dear collegaes, please let me ask your help to find a solution for my data analisys.
I have a P0300.txt file that contains a long strip.
here is a portion of P0300.txt:
59 04 03 01 00 65 01 3E 51 09 00 00 51 1C 00 E1
I need to find sets of data, sets could be 2 or 4 digits.
lets say I need to find 01 3E
DATA = regexp(fileread(‘P0300.txt’), ‘r?n’, ‘split’)’;
>> A = string(DATA);
>> B = strfind(A,’01 3E’);
B gives me the position where 01 3E is, in this case B = 19
after this I need to extract the 6 digits on the rigth 51 09 00 <– this values can change depend on test conditions
Any idea on how can I do that?
your feedback will be highly appreciated strings, text, data MATLAB Answers — New Questions
Is there version compatibility for the Model Advisor Configuration?
I get the following error message when trying to load a MATLAB R2020a Model Advisor Configuration JSON file in MATLAB R2020b:
Unable to load check "mathworks.jmaab.jc_0627". The check information specified in configuration file might be different than information needed for this release of the check. For example, if the number of check input parameters has changed from a previous release when you open the configuration file, the check does not load.
I confirmed that the check "jc_0627" exists in both R2020a and R2020b.
To produce this issue, I selected only "Check usage of Discrete-Time Integrator block (jc_0627)" in Model Advisor and saved it as a JSON file through the Model Advisor Configuration Editor in MATLAB R2020a. Then I loaded the saved JSON in R2020b through Model Advisor Configuration Editor. However, when I tested the above same workflow in R2020b to R2021a, there is no compatibility issue. Why is there a discrepancy? I get the following error message when trying to load a MATLAB R2020a Model Advisor Configuration JSON file in MATLAB R2020b:
Unable to load check "mathworks.jmaab.jc_0627". The check information specified in configuration file might be different than information needed for this release of the check. For example, if the number of check input parameters has changed from a previous release when you open the configuration file, the check does not load.
I confirmed that the check "jc_0627" exists in both R2020a and R2020b.
To produce this issue, I selected only "Check usage of Discrete-Time Integrator block (jc_0627)" in Model Advisor and saved it as a JSON file through the Model Advisor Configuration Editor in MATLAB R2020a. Then I loaded the saved JSON in R2020b through Model Advisor Configuration Editor. However, when I tested the above same workflow in R2020b to R2021a, there is no compatibility issue. Why is there a discrepancy? I get the following error message when trying to load a MATLAB R2020a Model Advisor Configuration JSON file in MATLAB R2020b:
Unable to load check "mathworks.jmaab.jc_0627". The check information specified in configuration file might be different than information needed for this release of the check. For example, if the number of check input parameters has changed from a previous release when you open the configuration file, the check does not load.
I confirmed that the check "jc_0627" exists in both R2020a and R2020b.
To produce this issue, I selected only "Check usage of Discrete-Time Integrator block (jc_0627)" in Model Advisor and saved it as a JSON file through the Model Advisor Configuration Editor in MATLAB R2020a. Then I loaded the saved JSON in R2020b through Model Advisor Configuration Editor. However, when I tested the above same workflow in R2020b to R2021a, there is no compatibility issue. Why is there a discrepancy? modeladvisorconfiguration, modeladvisor, simulinkcheck MATLAB Answers — New Questions
I need to run Optimization using models I generated in Regression Learner
Hi, all!
I desperately need help. As the title says, I generated multiple surrogate models on Regression Learner; now I need to use these models in a gradient-based optimization process.
I’ve tried Export>Generate Function & Export>Export Model / Export Model For Deployment. None of them work, I don’t understand how anything works. If I can convert the surrogate models into matlab functions, these matlab functions are supposed to go into the ‘select problem data>Objective function’? How do I define lower/upper bounds with just one value for each when the surrogate models have multiple inputs?? How do I define non-linear constraints??
I put an image just to explain my problem better.
Thank you….Hi, all!
I desperately need help. As the title says, I generated multiple surrogate models on Regression Learner; now I need to use these models in a gradient-based optimization process.
I’ve tried Export>Generate Function & Export>Export Model / Export Model For Deployment. None of them work, I don’t understand how anything works. If I can convert the surrogate models into matlab functions, these matlab functions are supposed to go into the ‘select problem data>Objective function’? How do I define lower/upper bounds with just one value for each when the surrogate models have multiple inputs?? How do I define non-linear constraints??
I put an image just to explain my problem better.
Thank you…. Hi, all!
I desperately need help. As the title says, I generated multiple surrogate models on Regression Learner; now I need to use these models in a gradient-based optimization process.
I’ve tried Export>Generate Function & Export>Export Model / Export Model For Deployment. None of them work, I don’t understand how anything works. If I can convert the surrogate models into matlab functions, these matlab functions are supposed to go into the ‘select problem data>Objective function’? How do I define lower/upper bounds with just one value for each when the surrogate models have multiple inputs?? How do I define non-linear constraints??
I put an image just to explain my problem better.
Thank you…. optimization MATLAB Answers — New Questions
Why does MATLAB Statistics and Machine Learning Toolbox “manova1” give different results than R?
I am performing the one-way MANOVA in MATLAB using "manova1" from Statistics and Machine Learning Toolbox. Why are the resultant values different than the results obtained from R?I am performing the one-way MANOVA in MATLAB using "manova1" from Statistics and Machine Learning Toolbox. Why are the resultant values different than the results obtained from R? I am performing the one-way MANOVA in MATLAB using "manova1" from Statistics and Machine Learning Toolbox. Why are the resultant values different than the results obtained from R? manova, manova1, barttest MATLAB Answers — New Questions
How do I find libraries with unsaved changes?
I’m trying to build code via rtwbuild and am being met with the error Selected subsystem is linked to a library with unsaved changes. Please save the library.
I’ve been manually looking through the model and can’t see anything with unsaved changes or broken links. And there seems to be no easy way to find the library with unsaved changes in question. Am I missing something or is there a way to find these libraries? I’m working with a very big model.I’m trying to build code via rtwbuild and am being met with the error Selected subsystem is linked to a library with unsaved changes. Please save the library.
I’ve been manually looking through the model and can’t see anything with unsaved changes or broken links. And there seems to be no easy way to find the library with unsaved changes in question. Am I missing something or is there a way to find these libraries? I’m working with a very big model. I’m trying to build code via rtwbuild and am being met with the error Selected subsystem is linked to a library with unsaved changes. Please save the library.
I’ve been manually looking through the model and can’t see anything with unsaved changes or broken links. And there seems to be no easy way to find the library with unsaved changes in question. Am I missing something or is there a way to find these libraries? I’m working with a very big model. simulink MATLAB Answers — New Questions
Why does the update installer fail with “Error: ENOENT: no such file or directory” and mentions an appdata folder?
Why do I receive the error "Error: ENOENT: no such file or directory, scandir ‘C:Program FilesMATLABR20XXyappdataproducts’"Why do I receive the error "Error: ENOENT: no such file or directory, scandir ‘C:Program FilesMATLABR20XXyappdataproducts’" Why do I receive the error "Error: ENOENT: no such file or directory, scandir ‘C:Program FilesMATLABR20XXyappdataproducts’" MATLAB Answers — New Questions
Help to create a continuous surface heatmap
Dear experts –
I want to create a continuous 1D surface heatmap for every data point, with Distance (ft) in the X-direction and Temperature in the Y-direction. I have no idea how to do it. Please, can someone helps me with that.
Here I attached a sample of my data.
Thank you!Dear experts –
I want to create a continuous 1D surface heatmap for every data point, with Distance (ft) in the X-direction and Temperature in the Y-direction. I have no idea how to do it. Please, can someone helps me with that.
Here I attached a sample of my data.
Thank you! Dear experts –
I want to create a continuous 1D surface heatmap for every data point, with Distance (ft) in the X-direction and Temperature in the Y-direction. I have no idea how to do it. Please, can someone helps me with that.
Here I attached a sample of my data.
Thank you! heatmap MATLAB Answers — New Questions
Why am I getting a computed maximum size is not bounded error in a MATLAB Function block in Simulink R2021a even when using assert?
I am using a Matlab function in Simulink and want to create arrays whose size varies. However, I can specify the maximum size in advance. I got the following error message, although I am already using the assert function.
Computed maximum size of the output of function ‘colon’ is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?]. More informationFunction ‘Control_Model/Current Controller ILR and PI/MATLAB Function’ (#24.2546.2574), line 86, column 24: "iL_NL_act:1:(iL_NL_act_plLL)" Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Computed maximum size of the output of function ‘colon’ is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?]. More informationFunction ‘Control_Model/Current Controller ILR and PI/MATLAB Function’ (#24.2602.2630), line 87, column 24: "iR_NL_act:1:(iR_NL_act_plLL)" Launch diagnostic report.
Here is the corresponding code:
LL = 7;
assert (varyingInput_a <= 800)
assert (varyingInput_b <= 800)
varyingInput_a_plusLL = varyingInput_a+LL;
varyingInput_b_plusLL = varyingInput_b+LL;
assert (varyingInput_a_plusLL <= 800)
assert (varyingInput_b_plusLL <= 800)
iLrange_act(1:LL+1) = (varyingInput_a:1:(varyingInput_a_plusLL))-m;
iRrange_act(1:LL+1) = (varyingInput_b:1:(varyingInput_b_plusLL))-m;
I had the same problem before in the same Matlab function for an input variable from which the variables used here are calculated. There I also used the assert function and the error no longer occurred. I would have expected that using the function once before using the variable for the first time would be enough to limit all other variables derived/calculated from it.
Here is the code from the first assert use:
assert (N_act <= 800)
Angel4Nact = [1:1:N_act]*(2*pi/N_act);
varyingInput_a and varyingInput_b are calculated using N_actI am using a Matlab function in Simulink and want to create arrays whose size varies. However, I can specify the maximum size in advance. I got the following error message, although I am already using the assert function.
Computed maximum size of the output of function ‘colon’ is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?]. More informationFunction ‘Control_Model/Current Controller ILR and PI/MATLAB Function’ (#24.2546.2574), line 86, column 24: "iL_NL_act:1:(iL_NL_act_plLL)" Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Computed maximum size of the output of function ‘colon’ is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?]. More informationFunction ‘Control_Model/Current Controller ILR and PI/MATLAB Function’ (#24.2602.2630), line 87, column 24: "iR_NL_act:1:(iR_NL_act_plLL)" Launch diagnostic report.
Here is the corresponding code:
LL = 7;
assert (varyingInput_a <= 800)
assert (varyingInput_b <= 800)
varyingInput_a_plusLL = varyingInput_a+LL;
varyingInput_b_plusLL = varyingInput_b+LL;
assert (varyingInput_a_plusLL <= 800)
assert (varyingInput_b_plusLL <= 800)
iLrange_act(1:LL+1) = (varyingInput_a:1:(varyingInput_a_plusLL))-m;
iRrange_act(1:LL+1) = (varyingInput_b:1:(varyingInput_b_plusLL))-m;
I had the same problem before in the same Matlab function for an input variable from which the variables used here are calculated. There I also used the assert function and the error no longer occurred. I would have expected that using the function once before using the variable for the first time would be enough to limit all other variables derived/calculated from it.
Here is the code from the first assert use:
assert (N_act <= 800)
Angel4Nact = [1:1:N_act]*(2*pi/N_act);
varyingInput_a and varyingInput_b are calculated using N_act I am using a Matlab function in Simulink and want to create arrays whose size varies. However, I can specify the maximum size in advance. I got the following error message, although I am already using the assert function.
Computed maximum size of the output of function ‘colon’ is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?]. More informationFunction ‘Control_Model/Current Controller ILR and PI/MATLAB Function’ (#24.2546.2574), line 86, column 24: "iL_NL_act:1:(iL_NL_act_plLL)" Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Computed maximum size of the output of function ‘colon’ is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [1 x :?]. More informationFunction ‘Control_Model/Current Controller ILR and PI/MATLAB Function’ (#24.2602.2630), line 87, column 24: "iR_NL_act:1:(iR_NL_act_plLL)" Launch diagnostic report.
Here is the corresponding code:
LL = 7;
assert (varyingInput_a <= 800)
assert (varyingInput_b <= 800)
varyingInput_a_plusLL = varyingInput_a+LL;
varyingInput_b_plusLL = varyingInput_b+LL;
assert (varyingInput_a_plusLL <= 800)
assert (varyingInput_b_plusLL <= 800)
iLrange_act(1:LL+1) = (varyingInput_a:1:(varyingInput_a_plusLL))-m;
iRrange_act(1:LL+1) = (varyingInput_b:1:(varyingInput_b_plusLL))-m;
I had the same problem before in the same Matlab function for an input variable from which the variables used here are calculated. There I also used the assert function and the error no longer occurred. I would have expected that using the function once before using the variable for the first time would be enough to limit all other variables derived/calculated from it.
Here is the code from the first assert use:
assert (N_act <= 800)
Angel4Nact = [1:1:N_act]*(2*pi/N_act);
varyingInput_a and varyingInput_b are calculated using N_act simulink, matlab function, coder error, size not bounded, assert, 2021a MATLAB Answers — New Questions
Why inpolygon is not detecting the whole artificial reef structure?
Hi,
I’m encountering a problem while trying to adjust the bathymetry in my MATLAB code. I have successfully plotted the artificial reef structure. However, I’m having difficulty modifying the bathymetry to reflect a 4-meter depth for the structure instead of the initial 5 meters. I am using the inpolygon function, but it seems to be causing some issues and not detecting the whole structure.
The code plots correctly up to line 77, but I’m experiencing problems with the polygon section. I’ve attached the MATLAB code for review.
Could you please help me identify what might be going wrong?
Thank you!Hi,
I’m encountering a problem while trying to adjust the bathymetry in my MATLAB code. I have successfully plotted the artificial reef structure. However, I’m having difficulty modifying the bathymetry to reflect a 4-meter depth for the structure instead of the initial 5 meters. I am using the inpolygon function, but it seems to be causing some issues and not detecting the whole structure.
The code plots correctly up to line 77, but I’m experiencing problems with the polygon section. I’ve attached the MATLAB code for review.
Could you please help me identify what might be going wrong?
Thank you! Hi,
I’m encountering a problem while trying to adjust the bathymetry in my MATLAB code. I have successfully plotted the artificial reef structure. However, I’m having difficulty modifying the bathymetry to reflect a 4-meter depth for the structure instead of the initial 5 meters. I am using the inpolygon function, but it seems to be causing some issues and not detecting the whole structure.
The code plots correctly up to line 77, but I’m experiencing problems with the polygon section. I’ve attached the MATLAB code for review.
Could you please help me identify what might be going wrong?
Thank you! inpolygon MATLAB Answers — New Questions
“GlobalSearch”, for some inputs ends up in “NaN” and sqpInterface and fmincon error
Hi everyone,
I have a question regarding "GlobalSearch". For some inputs, my code sometimes ends up in "NaN" and the code gives this error:
"Error using sqpInterface
Objective function is undefined at initial point. Fmincon cannot continue.
Error in fmincon (line 871)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = sqpInterface(funfcn,X,full(A),full(B),full(Aeq),full(Beq), …
Error in globaloptim.globalsearch.globalsearchnlp
Error in GlobalSearch/run (line 340)
globaloptim.globalsearch.globalsearchnlp(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,options,localOptions);
Error in Optimization (line 37)
[A,f] = run(gs,problem);
Caused by:
Failure in initial call to fmincon with user-supplied problem structure."
Of course, we all know that the algorithm checks the different inputs and finally goes to the smallest objective function value (error).
Is there a way to ignore the inputs that give "NaN" results and make the algorithm use other inputs to finally reach to lowest objective function value (error)?Hi everyone,
I have a question regarding "GlobalSearch". For some inputs, my code sometimes ends up in "NaN" and the code gives this error:
"Error using sqpInterface
Objective function is undefined at initial point. Fmincon cannot continue.
Error in fmincon (line 871)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = sqpInterface(funfcn,X,full(A),full(B),full(Aeq),full(Beq), …
Error in globaloptim.globalsearch.globalsearchnlp
Error in GlobalSearch/run (line 340)
globaloptim.globalsearch.globalsearchnlp(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,options,localOptions);
Error in Optimization (line 37)
[A,f] = run(gs,problem);
Caused by:
Failure in initial call to fmincon with user-supplied problem structure."
Of course, we all know that the algorithm checks the different inputs and finally goes to the smallest objective function value (error).
Is there a way to ignore the inputs that give "NaN" results and make the algorithm use other inputs to finally reach to lowest objective function value (error)? Hi everyone,
I have a question regarding "GlobalSearch". For some inputs, my code sometimes ends up in "NaN" and the code gives this error:
"Error using sqpInterface
Objective function is undefined at initial point. Fmincon cannot continue.
Error in fmincon (line 871)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = sqpInterface(funfcn,X,full(A),full(B),full(Aeq),full(Beq), …
Error in globaloptim.globalsearch.globalsearchnlp
Error in GlobalSearch/run (line 340)
globaloptim.globalsearch.globalsearchnlp(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,options,localOptions);
Error in Optimization (line 37)
[A,f] = run(gs,problem);
Caused by:
Failure in initial call to fmincon with user-supplied problem structure."
Of course, we all know that the algorithm checks the different inputs and finally goes to the smallest objective function value (error).
Is there a way to ignore the inputs that give "NaN" results and make the algorithm use other inputs to finally reach to lowest objective function value (error)? globalsearch, fmincon, sqpinterface MATLAB Answers — New Questions
Failing to create matrix from cell array in several ways
לק"י
Hi guys,
I have a cell array in 64X61X21 size.
I want to make a matrix of the values (no vectors) within specific area of the cell array – 15:21,2:61,1:21.
First I make a copy of the cell array:
cellarrayneeded=analysisdayaWT(8:15, 2:60, 1:21);
cellarrayneeded=cell2mat(cellarrayneeded);
Error message I get:
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 118)
ct{mref{:}} = cat(cdim+1,c{mref{:},:});
When I try something else:
cellarrayneeded=cell2mat(analysisdataWT{8:15, 2:60, 1:21});
I get:
Error using cell2mat
Too many input arguments.
What am I doing wrong?
Thanks!לק"י
Hi guys,
I have a cell array in 64X61X21 size.
I want to make a matrix of the values (no vectors) within specific area of the cell array – 15:21,2:61,1:21.
First I make a copy of the cell array:
cellarrayneeded=analysisdayaWT(8:15, 2:60, 1:21);
cellarrayneeded=cell2mat(cellarrayneeded);
Error message I get:
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 118)
ct{mref{:}} = cat(cdim+1,c{mref{:},:});
When I try something else:
cellarrayneeded=cell2mat(analysisdataWT{8:15, 2:60, 1:21});
I get:
Error using cell2mat
Too many input arguments.
What am I doing wrong?
Thanks! לק"י
Hi guys,
I have a cell array in 64X61X21 size.
I want to make a matrix of the values (no vectors) within specific area of the cell array – 15:21,2:61,1:21.
First I make a copy of the cell array:
cellarrayneeded=analysisdayaWT(8:15, 2:60, 1:21);
cellarrayneeded=cell2mat(cellarrayneeded);
Error message I get:
Error using cat
Dimensions of arrays being concatenated are not consistent.
Error in cell2mat (line 118)
ct{mref{:}} = cat(cdim+1,c{mref{:},:});
When I try something else:
cellarrayneeded=cell2mat(analysisdataWT{8:15, 2:60, 1:21});
I get:
Error using cell2mat
Too many input arguments.
What am I doing wrong?
Thanks! cell arrays, matrix, cell2mat MATLAB Answers — New Questions
Colors of the bar are not same for the same height in 3d bar plot after applying log scale
I’m trying to plot 3D graph with bars, in which I’m using colormap. I have found a work around to apply colormap on bar3:
b = […] % my data
for k = 1:length(b)
zdata = b(k).ZData;
b(k).CData = zdata;
b(k).FaceColor = ‘interp’;
end
colormap(‘jet’)
I’m also applying log scale in Z axis. But it was messing up my plot and I found a work around for this also.
% Z log fix
llim = .1;
h = get(gca,’Children’);
for i = 1:length(h)
ZData = get(h(i), ‘ZData’);
ZData(ZData==0) = llim;
set(h(i), ‘ZData’, ZData);
end
But I’m getting the following result after the log fix where the bars don’t have same color at the same Z value (height).
I’m trying to get results like the following plot.
Anyone know the solution?I’m trying to plot 3D graph with bars, in which I’m using colormap. I have found a work around to apply colormap on bar3:
b = […] % my data
for k = 1:length(b)
zdata = b(k).ZData;
b(k).CData = zdata;
b(k).FaceColor = ‘interp’;
end
colormap(‘jet’)
I’m also applying log scale in Z axis. But it was messing up my plot and I found a work around for this also.
% Z log fix
llim = .1;
h = get(gca,’Children’);
for i = 1:length(h)
ZData = get(h(i), ‘ZData’);
ZData(ZData==0) = llim;
set(h(i), ‘ZData’, ZData);
end
But I’m getting the following result after the log fix where the bars don’t have same color at the same Z value (height).
I’m trying to get results like the following plot.
Anyone know the solution? I’m trying to plot 3D graph with bars, in which I’m using colormap. I have found a work around to apply colormap on bar3:
b = […] % my data
for k = 1:length(b)
zdata = b(k).ZData;
b(k).CData = zdata;
b(k).FaceColor = ‘interp’;
end
colormap(‘jet’)
I’m also applying log scale in Z axis. But it was messing up my plot and I found a work around for this also.
% Z log fix
llim = .1;
h = get(gca,’Children’);
for i = 1:length(h)
ZData = get(h(i), ‘ZData’);
ZData(ZData==0) = llim;
set(h(i), ‘ZData’, ZData);
end
But I’m getting the following result after the log fix where the bars don’t have same color at the same Z value (height).
I’m trying to get results like the following plot.
Anyone know the solution? bar3, 3d plots, colormap MATLAB Answers — New Questions
How can I turn a 1*1 cell into a cell array?
For example, what is the easiest way to turn a 1*1 cell ‘a b c d e’ into a cell array {‘a’} {‘b’} {‘c’} {‘d’} {‘e’}? Please! Anyone can help me?For example, what is the easiest way to turn a 1*1 cell ‘a b c d e’ into a cell array {‘a’} {‘b’} {‘c’} {‘d’} {‘e’}? Please! Anyone can help me? For example, what is the easiest way to turn a 1*1 cell ‘a b c d e’ into a cell array {‘a’} {‘b’} {‘c’} {‘d’} {‘e’}? Please! Anyone can help me? cell, cell array, split MATLAB Answers — New Questions
Pareto Optimization of 3 Parameters (Emission, Cost and Efficiency)
Hello 🙂
I want to make an Pareto Optimization of 3 Parameters. I have got 3 Types of energy generation plants. Every Type has got his own Costs, Emission and Efficiencys. So I want to Optimize them.
I found a Minimize function (viennet function) in a Matlab Tutorial on Youtube. Is that correct? Or how could I write a function to that problem?
Thanks forward!
Greetings,
AndreaHello 🙂
I want to make an Pareto Optimization of 3 Parameters. I have got 3 Types of energy generation plants. Every Type has got his own Costs, Emission and Efficiencys. So I want to Optimize them.
I found a Minimize function (viennet function) in a Matlab Tutorial on Youtube. Is that correct? Or how could I write a function to that problem?
Thanks forward!
Greetings,
Andrea Hello 🙂
I want to make an Pareto Optimization of 3 Parameters. I have got 3 Types of energy generation plants. Every Type has got his own Costs, Emission and Efficiencys. So I want to Optimize them.
I found a Minimize function (viennet function) in a Matlab Tutorial on Youtube. Is that correct? Or how could I write a function to that problem?
Thanks forward!
Greetings,
Andrea optimization, pareto front MATLAB Answers — New Questions
How to Install and Use Gazebo Plugin in Simulink for Accessing ROS Topics with MAVROS and PX4 Autopilot?
I’m working on a project where I use Simulink to interface with ROS and Gazebo. My setup involves communicating with an Iris drone that uses the PX4 Autopilot, and I am using MAVROS for this communication. Typically, I launch ROS and Gazebo using the following commands:
HEADLESS=1 make px4_sitl gazebo
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14540"
However, I’m having difficulty accessing ROS topics from within the Simulink environment. I believe I need to install the Gazebo plugin for Simulink, but I’m unsure of the exact steps to do this.
Could someone guide me through the process of installing and configuring the Gazebo plugin in Simulink? Any specific instructions for ensuring that I can properly access ROS topics from Simulink would be greatly appreciated.I’m working on a project where I use Simulink to interface with ROS and Gazebo. My setup involves communicating with an Iris drone that uses the PX4 Autopilot, and I am using MAVROS for this communication. Typically, I launch ROS and Gazebo using the following commands:
HEADLESS=1 make px4_sitl gazebo
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14540"
However, I’m having difficulty accessing ROS topics from within the Simulink environment. I believe I need to install the Gazebo plugin for Simulink, but I’m unsure of the exact steps to do this.
Could someone guide me through the process of installing and configuring the Gazebo plugin in Simulink? Any specific instructions for ensuring that I can properly access ROS topics from Simulink would be greatly appreciated. I’m working on a project where I use Simulink to interface with ROS and Gazebo. My setup involves communicating with an Iris drone that uses the PX4 Autopilot, and I am using MAVROS for this communication. Typically, I launch ROS and Gazebo using the following commands:
HEADLESS=1 make px4_sitl gazebo
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14540"
However, I’m having difficulty accessing ROS topics from within the Simulink environment. I believe I need to install the Gazebo plugin for Simulink, but I’m unsure of the exact steps to do this.
Could someone guide me through the process of installing and configuring the Gazebo plugin in Simulink? Any specific instructions for ensuring that I can properly access ROS topics from Simulink would be greatly appreciated. simulink, ros, gazebo, px4, mavros MATLAB Answers — New Questions
I need help for optimization using Ga
I want to make optimization using genetic algorithm to minimize error between force and displacement (simulated and desired ) . I have 3 numbers of variables (height , depth , width) .. can anyone help me for the coding pleaseI want to make optimization using genetic algorithm to minimize error between force and displacement (simulated and desired ) . I have 3 numbers of variables (height , depth , width) .. can anyone help me for the coding please I want to make optimization using genetic algorithm to minimize error between force and displacement (simulated and desired ) . I have 3 numbers of variables (height , depth , width) .. can anyone help me for the coding please matlab, genetic algorithm MATLAB Answers — New Questions