Answered
index exceeds matrix dimension
In the first iteration, i=1, you evaluate alpha0 = alpha0(i); This replaces the vector |alpha0| by the scalar |alpha0(1)...

9 years ago | 0

| accepted

Answered
I want to open several windows, and to select a particular window to plot different variables . How to do this?
fig1 = figure( .... ); ax1 = axes; fig2 = figure( .... ); ax2 = axes; fig3 = figure( .... ); ax3 = axes; p...

9 years ago | 1

Answered
Inserting blank columns at specific points
What about: [s1, s2] = size(Numbers); MeanR = squeeze(mean(reshape(Numbers, s1, 2, s2/2), 2)); But this works only...

9 years ago | 1

Answered
How can I put in legend all cells from one cell array ?
Do you mean: legend(g) ? But for a {20 x 1} cell, this should be the same as |g(:,1)|. Therefore I do not understand, wh...

9 years ago | 1

Answered
difficulty in printing for 'cell' inputs.
while ~ feof(fid1) a = fgetl(fid1); b = strsplit(a); c = [b(end) b(1:end-1)]; fprintf(fid2, '%s\n', c{:})...

9 years ago | 1

Answered
Is it possible to sort an array by making the repeated elements in the last?
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength>: A = [-1 -1 -3 -5 -5]; [...

9 years ago | 0

Answered
Write loop for read then write multiple files
This is not meaningful: v=dir('*.bin') for i=1001:v |dir| replies a struct, which contains file names, dates, sizes a...

9 years ago | 0

| accepted

Answered
Filling in a 4d array
earth = zeros(221, 2, 360, 6); alien = rand(221, 2); size(earth(:, :, 1:360, 1:6)) size([alien(:,1), alien(:,2)]) ...

9 years ago | 0

Answered
How to use any size array as an input?
If you want to consider all elements and not the shape of the array: function [meanValue, medianValue] = statsFunction(arra...

9 years ago | 0

Answered
Replacing the zero entry of a vector with its nonzero entries
I guess, that you want to replace zeros by the nearest non-zero value. Then this is a job for |interp1|: z = (A == 0); ...

9 years ago | 3

Answered
How to iteratively split a matrix into multiple matrices according to a condition?
M = rand(100, 3); % Your data [~, ~, bin] = histcounts(M(:, 1), 10); % Split first column into 10 ...

9 years ago | 0

Answered
we have a pop up window saying 'Deactivation Required'
If 10.66.10.19 is the IP address of your computer, remember, that 10.0.0.0/8 is a public address block, such that many other com...

9 years ago | 0

| accepted

Answered
second condition never gets executed - elseif (temp == 13.2) tried to run in 13b, 15b online edittors as well, any explanations or its a bug?
This is not a bug, but the expected behavior of IEEE754 floating point values. See <https://www.mathworks.com/matlabcentral/answ...

9 years ago | 1

| accepted

Answered
How to xor the image pixel values with values in matrix form?
You can XOR the values directly instead of converting them to |char| vectors at first. frr = bin2dec('01010000'); q2 =...

9 years ago | 1

Answered
Define Variable Names in a double
|table2array| converts the table to an array, but arrays do not have names for the columns. Only tables contain such names. Ther...

9 years ago | 3

| accepted

Answered
Send plot from one axes to another
This copies the line objects from Axes1 to Axes2 using |copyobj|: Fig1 = figure; Axes1 = axes; LineH = plot(1:10, ra...

9 years ago | 0

Answered
Error in Genetic Algorithm ??
As soon as you create a standard function instead of an anonymous one, you can use the debugger to find out the details: fu...

9 years ago | 0

Answered
if inside of for loop
Or perhaps: match = (rt > 100 & rt < 1000); rtx = rt(match); cuex = cue(match); for i = 1:3 average(i) = m...

9 years ago | 1

| accepted

Answered
Matrix must agree HELP
You can examine the reason of errors using the debugger: <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-an...

9 years ago | 0

Answered
Check if two colors are similar
It depends on the definition of similarity. The comparison is not trivial: There are "a lot of similar" greens, but only a small...

9 years ago | 2

Answered
How do I avoid getting fooled by 'implicit expansion'?
Should I just never trust any command to preserve the dimensions of my arrays, even if it's an inbuilt one? The shapes of th...

9 years ago | 2

| accepted

Answered
Deactivation switch for implicit expansion
I'm convinced, that there is no switch to disable it. Otherwise it would have been mentioned in the forum.

9 years ago | 1

Answered
Index exceeds matrix dimensions for fprinf
Use the debugger to check the cause of the error: <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-featu...

9 years ago | 1

| accepted

Answered
MEX does not recognize compilers already installed
according to the <https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/SystemRequirements-Rele...

9 years ago | 0

Answered
Not able to run any GUI related code
Use the debugger to examine the problem: <https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html>...

9 years ago | 0

Answered
How to combine 4 .txt files in a single.txt file?
Create a list of file |File| at first. Then import the lines: File = {'a1.txt', 'a2.txt', 'a3.txt', 'a4.txt'}; % Thanks Wa...

9 years ago | 1

| accepted

Answered
Converting a matrix into another by a mapping table
a = [3 4 2; ... 3 4 1; ... 4 1 2]; c = [1 2; ... 2 3; ... ...

9 years ago | 1

| accepted

Answered
finding the common numbers in 2 arrays
See: doc ismember With code: a = [1,2,3,4,5,6] b = [4,8,6,10,11,12] nCommon = sum(ismember(a, b)) Maybe ...

9 years ago | 1

| accepted

Answered
Why is my function giving me a string when it should be giving a structure?
A guess: "Values less than 0" is |x < 0|, not |x <= 0|. This is not _meaningful_ for |mass| and |passengers|, but according to t...

9 years ago | 0

Answered
binary vector function and hide image function erorr
Use the debugger to find the problem: dbstop if error Now run the code again and check the indices used in the failing l...

9 years ago | 0

Load more