Answered
How to keep certain numbers in a cell array?
A = {{1,2,3},{4,5,6},{7,8,9},{10,11,12}}; B = [1,3,5,12]; R = cell(size(A)); for iA = 1:numel(A) v = cat(2, ...

9 years ago | 0

| accepted

Answered
what function for computing all subsets given an array of consecutive number?
a = 1:12; R = cell(1, numel(a) + 1); R{1} = []; for k = 1:numel(a) R{k + 1} = nchoosek(a, k); end Now |R{k...

9 years ago | 1

Answered
separate cell arrays by comma
|csvwrite| is not the proper command, because it handles numerical data only. C = {'David', 'Ian'}; fid = fopen('Test.cs...

9 years ago | 0

Answered
Using a for-loop with several input matrices
TestSet = {[0 0 0 0], ... [1, 1, 1, 1], ... [235.0623 188.2428 44.9479 103.4551]}; DCTTEST = ...

9 years ago | 0

Answered
Summation with FOR Loop
You cannot run a loop from 1 to infinity in Matlab. Either solve the summation symbolically or find out, if this sum converges a...

9 years ago | 0

Answered
openfig doesn't assign fig number
If the 'IntegerHandle' property of the figure is set to 'off', the figure dows not get a 'Number'. Either set 'IntegerHandle' to...

9 years ago | 0

| accepted

Answered
How to make an html file to be read in a uipanel?
See <https://www.mathworks.com/matlabcentral/answers/86893-gui-matlab-show-an-html-file-in-a-panel-using-a-select-box>: Use e...

9 years ago | 1

| accepted

Answered
Bidirectional concatenation using cat (image zero-padding)
You could write a function for this purpose: function ImgP = ImagePad(Img, xPad, yPad) siz = size(Img); ImgP = zeros...

9 years ago | 1

| accepted

Answered
Time elapsed for running a GUI program
tic; [BestPosition,BestResult,Response,History] = MasterIO(Popsize,MaxIteration,NoOfVar,... ...

9 years ago | 0

Answered
time of execution of a code in matlab
Can you find the code lines inside |freqxorr| which are accelereated on the faster computer. It could either be multi-threading ...

9 years ago | 0

| accepted

Answered
How do i calculate knee joint angle from a marker on thigh and shank only?
No, this cannot work. If you have the 3D coordinates of 2 markers only, you cannot determine the knee joint and in consequence t...

9 years ago | 0

Answered
multi dimentional matrix multiplication problem
You assume, that the multiplication is the problem, buit the error message tells you, that the assignment ist the problem. U...

9 years ago | 1

| accepted

Answered
Why does "find" command fail to find a number in this vector?
:-) The evergreen frequently asked question. See. <https://www.mathworks.com/matlabcentral/answers/57444-faq-why-is-0-3-0-2-0...

9 years ago | 0

| accepted

Answered
n*2 matrix which come from output--Row is not fixed but column is 2--- and that process rotate in loop 10 times save all values of loop in result matrix
A guess: name = cell(1, 10); a = 18: b = 22; for i = 1:10 r1 = randi([18 22],1,1); name{i} = (b-a)...

9 years ago | 0

Answered
How can I change the radius of a circle pointeur
This function can set exactly the same pointers as explained in the documentation: See <https://www.mathworks.com/help/matlab/re...

9 years ago | 0

| accepted

Answered
How do I combine multiple MAT files into a single matrix
Try something like this: FileList = dir('*.mat'); DataC = cell(1, numel(FileList)); for iFile = 1:numel(FileList);...

9 years ago | 0

Answered
How can Matlab be forced to use copy of toolbox file instead of original file
Either give the edited file a new name. Or store it in a folder on top of the Matlab path. Matlab uses the first matching M-func...

9 years ago | 0

Answered
Elements processing in array
With <http://www.mathworks.com/matlabcentral/fileexchange/26242-vchoosekro>: n = numel(A); M = VChooseKRO([-1, 1], n) * ...

9 years ago | 1

Answered
Elements processing in array
n = numel(A); M = (1 - 2 * (dec2bin(0:2^n-1) - '0')) * A(:); [EDITED, parenthesis inserted]

9 years ago | 0

Answered
Varagin function with a vector
You forgot to mention what you want to provide as input and get as output. I guess you do not need |varargin| at all: funct...

9 years ago | 0

| accepted

Answered
How to optimize my Matlab code ?
Start with omitting the brute |clear all|. It removes all loaded functions from the memory and reloading then from disk wastes a...

9 years ago | 0

Answered
why does my function for connecting the nearest separate pixel points not work?
The error messages are clear: At first you've tried to read the not existing file with the empty name. Then you have calle...

9 years ago | 0

| accepted

Answered
Move all the values of matrix starting from particular row of matrix and replace by zeros
Index = cumsum([1; 1 + (A(1:end-1, 4) ~= A(2:end, 2))]); B(Index, :) = A;

9 years ago | 1

| accepted

Answered
Eigenvalues and Eigenvectors - How do I work out which eigenvalue corresponds to which eigenvector?
No, the order of eigen-values and eigen-vectors is not mixed. (As Adam has said already)

9 years ago | 0

Answered
Replacing the numbers in a matrix
Do you mean all 8 surrounding elements? x = randi([0,5], 22, 22); % Example data Z = conv2(double(x == 0), ones(3, 3), ...

9 years ago | 0

| accepted

Answered
assign numbers to observations
If the names, values and their order should be represented, store them e.g. in a struct array: S(1).Name = 'ABC1'; S(1)....

9 years ago | 1

| accepted

Answered
How to pre-allocate an empty matrix ?
A pre-allocation would be: size1 = cellfun('size', s.labs, 1); appnd_data = zeros(sum(size1), 1); iPos ...

9 years ago | 2

| accepted

Answered
GUI not printing a Static text
The last part, does exactly what the commands define - if it is reached ever. Perhaps the code stops with an error before? Or so...

9 years ago | 0

| accepted

Answered
How to Set whole Array column to Nan if a specific value is that column is present?
tmpTemp(:, any(maxTemp < minTempMeanTresh, 1)) = NaN;

9 years ago | 1

| accepted

Answered
Integrating multiple callbacks in a GUI window
The |guidata| method is straight forward: function OpeningFcn(hFigure, EventData, handles) handles.Data = []; % Initia...

9 years ago | 0

Load more