Answered

Toggle button background color unable to change

I would first check if you are able to change the color of the togglebutton manually, e.g. h = uicontrol('style','togglebutt...

Toggle button background color unable to change

I would first check if you are able to change the color of the togglebutton manually, e.g. h = uicontrol('style','togglebutt...

etwa 7 Jahre ago | 0

Answered

Matlab GUI and slow execution

not much we can do without seeing the code, but as you suggest one possible reason for the slowing down could be if the number o...

Matlab GUI and slow execution

not much we can do without seeing the code, but as you suggest one possible reason for the slowing down could be if the number o...

etwa 7 Jahre ago | 0

| accepted

Answered

Calling some MATLAB function with suppressed outputs

Unfortunatley there is not (as far as I know; see for example <http://www.mathworks.com/matlabcentral/newsreader/view_thread/156...

Calling some MATLAB function with suppressed outputs

Unfortunatley there is not (as far as I know; see for example <http://www.mathworks.com/matlabcentral/newsreader/view_thread/156...

etwa 7 Jahre ago | 0

| accepted

Answered

Hierarchical clustering with only merging neighbouring clusters

I would suggest to request the code from the authors (Thirion et al.? if so, you can start here <https://github.com/bthirion/fro...

Hierarchical clustering with only merging neighbouring clusters

I would suggest to request the code from the authors (Thirion et al.? if so, you can start here <https://github.com/bthirion/fro...

etwa 7 Jahre ago | 0

Answered

what is the fastest way to do many univariate regression? same Y against different x, one x at a time

Not terribly different in practice, but if you want you could compute all of those regressions simultaneously using a sparse blo...

what is the fastest way to do many univariate regression? same Y against different x, one x at a time

Not terribly different in practice, but if you want you could compute all of those regressions simultaneously using a sparse blo...

etwa 7 Jahre ago | 0

Answered

Matlab code problem (calculate eigenvalues and eigenvectors)

In your example the matrix A is not <https://en.wikipedia.org/wiki/Normal_matrix normal> (check that A*A'-A'*A is not zero), hen...

Matlab code problem (calculate eigenvalues and eigenvectors)

In your example the matrix A is not <https://en.wikipedia.org/wiki/Normal_matrix normal> (check that A*A'-A'*A is not zero), hen...

etwa 7 Jahre ago | 0

Answered

How to perform skull stripping using matlab?

Assuming that you do not have simply that slice but the entire MRI scan (e.g. a filename.nii or filename.img file) I would sugge...

How to perform skull stripping using matlab?

Assuming that you do not have simply that slice but the entire MRI scan (e.g. a filename.nii or filename.img file) I would sugge...

mehr als 7 Jahre ago | 3

Answered

Random zero-restrictions in vector

B1 = B; i = randperm(numel(B)); c = sparse(find(B(i)),nonzeros(B(i)),1); B1(i(~any(c&cumsum(c,1)>repmat(A,size(c,1),1)...

Random zero-restrictions in vector

B1 = B; i = randperm(numel(B)); c = sparse(find(B(i)),nonzeros(B(i)),1); B1(i(~any(c&cumsum(c,1)>repmat(A,size(c,1),1)...

mehr als 7 Jahre ago | 1

Answered

Combine convolution filters (bandpass) into a single kernel

Convolution is a linear operation so yes, you can combine the two filtering operations into one. Just make the filters the same ...

Combine convolution filters (bandpass) into a single kernel

Convolution is a linear operation so yes, you can combine the two filtering operations into one. Just make the filters the same ...

mehr als 7 Jahre ago | 0

| accepted

Answered

Substituting a number for NaN in anonymous function

There may be "cleaner" ways to do this but one possibility would be: g = @(x) [f(x) 1]*sparse(1+isnan(f(x)),1,1,2,1); ...

Substituting a number for NaN in anonymous function

There may be "cleaner" ways to do this but one possibility would be: g = @(x) [f(x) 1]*sparse(1+isnan(f(x)),1,1,2,1); ...

mehr als 7 Jahre ago | 1

| accepted

Answered

evalin in caller a command that assigns in caller

There is no viable work-around for nested evalins, but your particular example does not really require them. You could for examp...

evalin in caller a command that assigns in caller

There is no viable work-around for nested evalins, but your particular example does not really require them. You could for examp...

fast 8 Jahre ago | 0

Answered

Why is drawnow ignoring object ordering during animation?

You may use plot3(x, y, z,...) and text(x, y, z,...) and control the relative front/behind positions of these elements with the ...

Why is drawnow ignoring object ordering during animation?

You may use plot3(x, y, z,...) and text(x, y, z,...) and control the relative front/behind positions of these elements with the ...

fast 8 Jahre ago | 0

Answered

ind2sub doesn't work

You are funny. _ind2sub_ reshapes the _siz_ first argument to match the number of output variables used (in your case a singl...

ind2sub doesn't work

You are funny. _ind2sub_ reshapes the _siz_ first argument to match the number of output variables used (in your case a singl...

fast 8 Jahre ago | 1

| accepted

Answered

eig versus svd functions?

SVD is a decomposition for arbitrary-size matrices, while EIG applies only to square matrices. They are very much related: Th...

eig versus svd functions?

SVD is a decomposition for arbitrary-size matrices, while EIG applies only to square matrices. They are very much related: Th...

fast 8 Jahre ago | 2

| accepted

Answered

How can i create a vector with specific values at different positions?

close enough: v([3:7 10:14 16:18 20:25]) = 1;

How can i create a vector with specific values at different positions?

close enough: v([3:7 10:14 16:18 20:25]) = 1;

fast 8 Jahre ago | 1

| accepted

Answered

scatter plotting color coded

perhaps something along these lines: % your data (assuming column vectors) lat = convn(randn(1e3,1),hanning(100)); l...

scatter plotting color coded

perhaps something along these lines: % your data (assuming column vectors) lat = convn(randn(1e3,1),hanning(100)); l...

fast 8 Jahre ago | 0

Answered

Splitting a vector into vectors of different length

This is interesting, perhaps something like this would do (this implements a greedy correction of your initial estimate of the d...

Splitting a vector into vectors of different length

This is interesting, perhaps something like this would do (this implements a greedy correction of your initial estimate of the d...

fast 8 Jahre ago | 0

| accepted

Answered

picking a random solution to linear equations

I like your _Matlab can do anything_ remark. The _evenly space_ condition is a bit hard to achieve, but here some thoughts anywa...

picking a random solution to linear equations

I like your _Matlab can do anything_ remark. The _evenly space_ condition is a bit hard to achieve, but here some thoughts anywa...

fast 8 Jahre ago | 1

| accepted

Answered

GUI push button problem

You simply need to add the line: drawnow; to the code running the simulation steps so that Matlab flushes the event queue...

GUI push button problem

You simply need to add the line: drawnow; to the code running the simulation steps so that Matlab flushes the event queue...

fast 8 Jahre ago | 2

| accepted

Answered

regexp and string rearrange in text file

something along these lines: % reads file into cell array lines = textread('lsit2.txt','%s','delimiter','\n','whitespace...

regexp and string rearrange in text file

something along these lines: % reads file into cell array lines = textread('lsit2.txt','%s','delimiter','\n','whitespace...

fast 8 Jahre ago | 0

| accepted

Answered

How to run m-file from another m-file by input string

try this: ... fclose(f); rehash; run(save_name); also make sure that your variable _save_name_ does not include the...

How to run m-file from another m-file by input string

try this: ... fclose(f); rehash; run(save_name); also make sure that your variable _save_name_ does not include the...

fast 8 Jahre ago | 0

| accepted

Answered

Inserting NaN in particular spots of my matrix, all while "preserving" or shifting all other numbers

If I am interpreting correctly (not really sure if this is what you mean by "shifted down") this should do: c = nan(size(a...

Inserting NaN in particular spots of my matrix, all while "preserving" or shifting all other numbers

If I am interpreting correctly (not really sure if this is what you mean by "shifted down") this should do: c = nan(size(a...

fast 8 Jahre ago | 0

| accepted

Answered

Regarding Mutual information calculation of two binary strings

When computing mutual information you may assume that 0*log(0) == 0. In your code you could remove all the "if XXX==0" checks,...

Regarding Mutual information calculation of two binary strings

When computing mutual information you may assume that 0*log(0) == 0. In your code you could remove all the "if XXX==0" checks,...

fast 8 Jahre ago | 1

| accepted

Answered

corrcoef : p value interpretation

There are several issues here: *1) regarding why you are getting not significant values in your example:* N = 1000; X =...

corrcoef : p value interpretation

There are several issues here: *1) regarding why you are getting not significant values in your example:* N = 1000; X =...

fast 8 Jahre ago | 4

| accepted

Answered

How to read files' names efficiently

Something like: files = dir; % Your list of files [~,filenames] = cellfun(@fileparts,{files.name},'uni',0); % Your list ...

How to read files' names efficiently

Something like: files = dir; % Your list of files [~,filenames] = cellfun(@fileparts,{files.name},'uni',0); % Your list ...

fast 8 Jahre ago | 0

Answered

Updating handles from within Position Changed Callback

Your figure might have a resizefcn callback that could be reverting those values. Check: get(gcf,'resizefcn');

Updating handles from within Position Changed Callback

Your figure might have a resizefcn callback that could be reverting those values. Check: get(gcf,'resizefcn');

fast 8 Jahre ago | 2

| accepted

Answered

Help with the interpolate function

Use interp1 instead of interp

Help with the interpolate function

Use interp1 instead of interp

fast 8 Jahre ago | 0

| accepted

Answered

Quadratic time detrending. Any help or code ???

Yes, that should work, you just need to define: Ynew = Y - Th; to get the new "detrended" timeseries.

Quadratic time detrending. Any help or code ???

Yes, that should work, you just need to define: Ynew = Y - Th; to get the new "detrended" timeseries.

fast 8 Jahre ago | 0

| accepted

Answered

Turn my (easy) for loop into a recursive function?

You almost got it. Your are just: 1) overwriting the variable N, which you probably did not intend; and 2) including an unnecess...

Turn my (easy) for loop into a recursive function?

You almost got it. Your are just: 1) overwriting the variable N, which you probably did not intend; and 2) including an unnecess...

fast 8 Jahre ago | 0

| accepted