Answered
Looking for an efficient method to repeat the script command for multiple files
It is a bold guess only: initial='C:\Documents\MATLAB\Neuralynx\9Hz\'; for i = 1:x name = sprintf('CSC%d.ncs',i); ...

8 years ago | 0

Answered
Adding a marker in a 3d figure
You can search in this forum or in the internet for "Matlab image 3D". You will find e.g. these links: * <https://www.mathwor...

8 years ago | 0

| accepted

Answered
Matlab GUI break while loop behavior change
Try to insert a |drawnow|. By the way: axes(handles.frameAxis); cla; imshow(movieFrame); ...

8 years ago | 0

| accepted

Answered
Speed-up or get rid of loop with find function
list = randi(100, [100 1]); val = randi(100, [200 300]); for ii = 1:length(list) [y,x] = find( val == list(ii) );...

8 years ago | 1

| accepted

Answered
what happen with my matlab ??
The message is clear: "The following products need a supported compiler". Here "supported compiler" is a link and I assume you g...

8 years ago | 0

Answered
remove rows zeros( condition remove)
A = [1 2 3 4 5; ... 0 0 0 8 9; ... 4 5 8 5 6; ... 0 0 0 8 6] ; ...

8 years ago | 1

Answered
when i opened my matlab it showed a warning. Can somebody tell me what is this and help me to fix this
Did you modify the file |matlabrc.m|? If so recreate it from your backup. You can edit it with an external editor also. Search f...

8 years ago | 0

Answered
how can print every word in new line but skip printing if word is repeating..this is a sorted list of words
str = fileread('textfile.txt'); str(ismember(str, sprintf('.,\n\r'))) = ' '; words = unique(strsplit(str, ' ')); fi...

8 years ago | 0

Answered
Increasing increment values with vector operations
This is leaner than your loop: a = (5:15) .^ 2

8 years ago | 3

| accepted

Answered
How do I access a field on a struct which is not always in the same level?
Create a function which checks the existence of the subfield: function Data = getSubField(S, F1, F2) if isfield(S, F2) ...

8 years ago | 1

| accepted

Answered
Plot of rows from different cells of a cell array
Working with cell arrays is not useful here. Simply convert the data to a numerical 3D array at first: SNRd = cat(3, SNR{:}...

8 years ago | 0

| accepted

Answered
How to pad extra 0 after 5 consecutive 1's in an array
a = [1 1 1 1 1 1 1 1 1 1 1 1]; b = a; idx = strfind(a, [1,1,1,1,1]) if ~isempty(idx) % Remove indices with a t...

8 years ago | 2

Answered
How to calculate trace(A' * B) using SVD vectors of A and B?
I assume this is faster: nd = 100000; nt = 500; A = rand(nd, nt); B = rand(nd, nt); tic; abTr = trace(A' ...

8 years ago | 0

Answered
rotate vectors onto each other and Euler angles
Let's assume we talk about the 3D case. A rotation matrix is an ortho-normal 3x3 matrix. |R.' * R| is the unity matrix, or in...

8 years ago | 0

| accepted

Answered
How can I sum over specific dimensions in a n-dimensional array?
Join the trailing dimensions at first: x = rand(2,3,4,5,6); d = 3; n = ndims(x); s = num2cell(size(x)); y =...

8 years ago | 1

| accepted

Answered
Unable to determine the file format
imread('name.bmp') >> error of "Unable to Determine the file format" (Please post a copy of the *complete* error message...

8 years ago | 1

| accepted

Answered
How can I optimize my Matlab function and bypass a lot str2double calls?
Avoid repeated work by moving the conversion before the loop: tmp = str2double(times{1,i}{1}); for k = 1:length(x) ...

8 years ago | 0

Answered
Am I allowed to write functions that have names of matlab functions (copyright)?
There have been reports in this forum about cases, in which using the name of a toolbox function without having a license for th...

8 years ago | 1

Answered
How to find the gradient of a gait curve?
A simplification of your loop: forcechange = diff(patientleftforceratioarray); timechange = diff(patienttimearray); ...

8 years ago | 0

| accepted

Answered
butterworth band pass filter
According to the documentation, this is correct: <https://www.mathworks.com/help/signal/ref/butter.html doc butter> (link)

8 years ago | 0

| accepted

Answered
How can i display the image position with maximum pixel value?
It depends on what "display" means. Maybe either a simple: disp([r,c]) or perhaps: plot(c, r, 'o') The more spec...

8 years ago | 0

Answered
What is your unusual use of MATLAB?
I've suggested to use the Matlab installation CD as an animated hardward smiley: <http://www.mathworks.com/matlabcentral/newsre...

8 years ago | 2

Answered
Function Can't work
See my answer given <https://www.mathworks.com/matlabcentral/answers/395183-creating-a-set-of-equally-spaced-cylinders-with-comm...

8 years ago | 0

Answered
Can i use Color map to find which color is the most used color in an image ?
Walter is right. What is the dominant color of the French flag? Imagine a photo of a traffic light in the dusk. Most of the pixe...

8 years ago | 0

Answered
Why do I keep having multiple GUIDE line errors?
You have created a script called "sum.m", which shadows the built-in function with the same name. This is a bad idea. The soluti...

8 years ago | 0

| accepted

Answered
".*" does not work need help
Since Matlab R2016b the elementwise multiplication uses "arithmetic expanding": The singleton dimensions are expanded to match t...

8 years ago | 0

Answered
why 'for' doesnt affect inner function?
A bold guess: X0 = zeros(12,1); X0(10,1) = -pi/2; X0(11,1) = pi/2; t = 0:0.01:20; for i = 0:50:200 [...

8 years ago | 0

| accepted

Answered
Will a MEX file increase performance for this loop example
What about omitting the loop: c = (intpos-1) * size(data,1); % Before the loops if possible d = sum(data(curBin(4460:50...

8 years ago | 0

Answered
If matlab -desktop elseif matlab -nodesktop
See: <https://www.mathworks.com/matlabcentral/answers/101542-is-it-possible-to-programmatically-check-whether-matlab-has-been-st...

8 years ago | 1

| accepted

Answered
Am I allowed to write functions that have names of matlab functions (copyright)?
The *names* of the function are not covered by a copy right. Of course, they are not: imagine the built-in functions "i" and "j"...

8 years ago | 0

Load more