Answered
Do threads continue to run in MEX files when executing has been passed back to MATLAB
What about trying it? Simply add a file output to the code running the thread, which appends the current time to a file every se...

8 years ago | 0

Answered
ismember in a different way
The values of Y do not matter in any way, do they? X = [1 2 5 9]; Y = [10 12 3 43 75 60 67 8 90]; Y(:) = 0; % Set ...

8 years ago | 0

| accepted

Answered
Figure: Move axis background above all graphics objects
Start with figure; axes('ClippingStyle', 'rectangle', ... % Crops the line already 'box', 'on', ... 'N...

8 years ago | 0

| accepted

Answered
Write for loop results in a matrix
X = B(:,1) - A(:,1).'; % >= R2016b ! Arithmetic expanding Y = B(:,2) - A(:,2).'; dist2 = sum(X.^2 + Y.^2); Now you ...

8 years ago | 0

Answered
How to find max and min values from the cell(x*1 matrix) array elements !!
The problem is, that you do not reset the minimal and maximal values inside the loop. An improved version: for m = 1:length(...

8 years ago | 0

Answered
real time recording of mic?
Is there a way to record sound in non-real-time? Does the documentation solve the problem already? See: * <https://www.ma...

8 years ago | 1

Answered
Most efficient way to generate an array around a central value
A bold guess: center = -4.3 step = 2 low = -7 high = 3 vhigh = center:step:high; vlow = center...

8 years ago | 0

| accepted

Answered
Create GUI figures which scale position and size based on resolution
Fig1H = figure('Units', 'normalized', 'Position', [0, 0, 0.25, 1], 'Name', 'Figure 1'); Fig2H = figure('Units', 'nor...

8 years ago | 1

| accepted

Answered
what accuracy can I expect from cubic interpolation ?
[X, Y] = meshgrid(0:1/4:1, 0:1/4:1); grid = X .^ 3; [Xi, Yi] = meshgrid(0:0.1:1, 0:0.1:1); interp = interp2(X...

8 years ago | 0

| accepted

Answered
Is it possible to project vector onto another vector that has different length ?
A projection between vectors of different sizes is not mathematically defined. So it depends on what you need: a = [a1, a2,...

8 years ago | 0

| accepted

Answered
Measure angles between two vectors solely counter - clockwise
In the 3D case: function A = AngleIn3D(V1, V2, View) % Input: V1, V2, View: [N x 3] vectors, each one can be [1 x 3] als...

8 years ago | 0

Answered
Country selection for simple web checks
Did you allow to store cookies from mathworks.com? After the selection and if the cookie is saved, this dialog does not appear a...

8 years ago | 0

| accepted

Answered
Is it possible to create subsystem in GUI?
You can create tabs: <https://www.mathworks.com/help/matlab/ref/uitabgroup.html> The other possible solutions are explained e...

8 years ago | 0

| accepted

Answered
Key press counter not updating
function counter_OpeningFcn(hObject, eventdata, handles, varargin) handles.output = hObject; handles.counter = 0; % S...

8 years ago | 0

| accepted

Answered
help me to fix this error
Your initial value has 9 elements: |[0 0 0 0 0 0 0 0 0]|, but |ex5ode| and |ex5bc| reply a [7 x 1] vector only. Of course the de...

8 years ago | 0

Answered
Displace images from a txt file
Use the debugger to find out, that your |translation_vector| is exactly the same in each iteration, because it contains the *dim...

8 years ago | 0

Answered
Major problem with Cholesky decomposition
Either this is a problem with the called libraries or a user defined function shadows the original one, but contains a bug. Plea...

8 years ago | 0

Answered
i am getting error ... ??? Undefined function or method
This means, that the file |fdct_wrapping.m| is not found in your Matlab |path|. I guess you have either forgotten to install the...

8 years ago | 0

Answered
How to average every n files in a cell array?
DATA = cat(3, data{:}); siz = size(DATA); DATA = reshape(DATA, siz(1), siz(2), 4, []); DaySMAv = squeeze(mean(DATA, ...

8 years ago | 1

| accepted

Answered
How can I pull a 3x3 matrix from a larger one inside a for loop?
A pre-allocation will be more efficient: The iterative growing of arrays is very expensive. Try this: len = length(APM2.B...

8 years ago | 0

| accepted

Answered
help me to fix this problem
Use the debugger, see e.g. <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html>. You can type...

8 years ago | 0

Answered
random matrix diagonal problem
Or: c = rand(5,5) .* (1 - eye(5)) Matt J's method requires less arithmetic operations and is more powerful, because it a...

8 years ago | 0

Answered
What is the color spec for default blue?
It depends on what you call "color spec". figure, axes; LineH = plot(rand(1, 10), 'o') get(LineH, 'Color') >>...

8 years ago | 2

Answered
Pathdef 2017a issues
What about trying, what is suggested in the dialog? Save the pathdef-m file in your startup folder. Which one is your startup fo...

8 years ago | 0

Answered
average sections of matrix
PpIX_Dose_Matrix = rand(31, 109); n = size(PpIX_Dose_Matrix, 2); k = 0; for f = 1:24:n k = k + 1; Ave_PpIX(...

8 years ago | 0

Answered
Tone playback based on GUI edit box input
y = cos(2 * pi * freq * t); sound(y, fs);

8 years ago | 1

| accepted

Answered
How to load txt files from subfolders
Files = dir('**/AVE*.txt'); for k = 1:length(Files) FileName = fullfile(Files(k).folder, Files(k).name); I...

8 years ago | 1

| accepted

Answered
How can I calculate the mean of a vector ?
Or: m = sum(V_freq1) / numel(V_freq1) Good ideas to solve such problems: docsearch mean help mean Internet se...

8 years ago | 0

Answered
Read specific columns from a large csv file
No. A CSV file is a text file. Matlab has to read each value to find the next one. There is no magic trick to reduce the work. ...

8 years ago | 0

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 1)
The message means, that you try to access |ComboValue(:,V)| with V > 1, but |size(ComboValue, 2)| is 1 only. Without seeing t...

8 years ago | 0

| accepted

Load more