Answered
convert from cell array to vector
a ={'1','2','3','4','5','6','7','8','8'}; n = str2double(a) This can be faster under some conditions: n = sscanf(sprintf('%s ...

7 years ago | 3

| accepted

Answered
Access to data without reading all of it
It is a very bad idea to create a huge data set with a size of 2 TB as text files. Do the files have a fixed width for all lines...

7 years ago | 0

Answered
Is MathWorks working on a dark mode for MATLAB similar to what Visual Studio offers?
I'm using Matlab Schemer from the FileExchange successfully and I'm happy with it. Unfortunately I cannot set Windows to the dar...

7 years ago | 1

Answered
How can I define two tones in a grayscale image
You cannot eliminate colors in a gray-scale image, but only set them to another value. img(img > 67 & img < 128) = 0; Here all...

7 years ago | 2

| accepted

Answered
Attempting to use complex variable results in input array non-numeric error for polyval
Of course neither the char vector 'G11' nor any tricks with num2str can solve the problem. But hiding indoices in the names of v...

7 years ago | 0

| accepted

Answered
how to save errors
failures = struct('iter', {}, 'str', {}); for i = 1:10 try output1=some_function1(input1,input2) output2=some_f...

7 years ago | 0

| accepted

Answered
Convert values upper triangular matrix into vector
At = A.'; m = tril(true(size(At))); v = At(m).' Maybe this is faster (>=R2016b due to auto-expanding): At = A.'; m = (1:...

7 years ago | 1

| accepted

Answered
Why can't I run my python script from Matlab?
See https://www.mathworks.com/help/matlab/call-python-libraries.html and https://www.mathworks.com/help/matlab/matlab_external/s...

7 years ago | 2

Answered
How to make a colour picker similar to this one in Matlab?
This looks similar to the built-in uisetcolor of R2019b, see https://www.mathworks.com/help/matlab/ref/uisetcolor.html -> Select...

7 years ago | 0

| accepted

Answered
Is it possible to make 'uisetcolor' integrated in GUI?
See https://undocumentedmatlab.com/blog/color-selection-components Here you find some examples for color pickers. I assume you ...

7 years ago | 0

Answered
Select random data from a matrix and replace it
A logical mask is much simpler than handling the indices: A = randi([0,1], 8, 8); % Test data p = 4; mask = (cumsum(A,...

7 years ago | 0

Answered
Pending Approval for File Exchange
You can contact MathWorks by using the Contact button on top of this page: the phone icon. Direct link: https://www.mathworks.co...

7 years ago | 0

| accepted

Answered
While loop does not repeat
The code should not work at all, because i is not defined before while i <= size(first_firm,1) But then Matlab assumes you mea...

7 years ago | 1

| accepted

Answered
How do i implement a gain of 10 inside my filter MAtlab?
See this: t = 1:30; x = rand(1, 30); % Some test data [b, a] = butter(3, 0.8); % A Butterworth filte...

7 years ago | 0

| accepted

Answered
Using Arrayfun for iterative plotting
For example: for iRow = 1:2 plot(Gen_Array{7,2}(:, iRow), Gen_Array{7,3}(:, iRow)); end I do not understand completely, wh...

7 years ago | 0

| accepted

Answered
Help with Multithreading!
If the data must be processed sequentially, you cannot run the task in a parallel way and therefor multi-threading will not help...

7 years ago | 0

Answered
Try catch on script for any error
nRetry = 8; for k = 1:nRetry try yourFunction(); break; % Exit from the loop on success catch ME ...

7 years ago | 1

| accepted

Answered
Why does my Command Window show different variables then my workspace?
So do I understand correctly: validateFolder() is a nested function. If you stop the debugger inside it, whos displays the varia...

7 years ago | 0

| accepted

Answered
How to browse and open txt file with columns separated by comma and then plot specific columns of txt file in app designer?
"I want to make an app in matlab app designer" appdesigner (By the way: It was extremely hard to find this command. I've searc...

7 years ago | 0

Answered
First variable of table formatted differently for similar CSV inputs
Look in line 70 to 77 of 02.csv: ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, extraInfo,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, session,1,,,,,,,,,,...

7 years ago | 1

| accepted

Answered
Implement the following matrix
The code overwrites dif_x in each iteration. Maybe you want to collect the different matrices instead: theta = [ 45 46 48] ; t...

7 years ago | 1

| accepted

Answered
Help window doesn't appear
This is a problem in the preferences folder. See https://www.mathworks.com/matlabcentral/answers/453269-create-a-backup-of-your-...

7 years ago | 2

| accepted

Answered
Record plotting like an animation
Record it in which format? See https://www.mathworks.com/help/matlab/creating_plots/animation-techniques-1.html https://www.ma...

7 years ago | 0

Answered
How to remove the duplicate in the cell array but still keep the array structure?
A = {[3 11];[6 5 8];[ 11 5];[5]}; for iA = 1:numel(A) a = A{iA}; for jA = iA + 1:numel(A) A{jA} = A{jA}(~ism...

7 years ago | 1

| accepted

Answered
the 'fprintf' problem
While sprintf replies the created string, the output of fprintf is the number of printed characters. In your case "10 will be 10...

7 years ago | 0

| accepted

Answered
How can I make this source code simple?
Hiding indices in the names of variables forces you to write such code. See TUTORIAL: How and why to avoid Eval When you use ar...

7 years ago | 0

Answered
how to combine the 3 channels L*a*b*?
Lab = cat(3, L, a, b)

7 years ago | 0

| accepted

Answered
Multiplication of 2 3d matrices
FactorRetPf = permute(nansum(TotWeightsPf .* NormClassRetPf, 2), [3,1,2]); FactorRetBM = permute(nansum(TotWeightsBM .*...

7 years ago | 1

Answered
Counting the number of a specific word in text.
Use uigetfile instead of an fragile input command. But even then you should check the output of fopen: [fid, msg] = fopen(filen...

7 years ago | 0

| accepted

Answered
Several loops in Matlab
A break can stop a loop prematurely: for i = 1:N A(i) = a*B(i); break; end for i = N:-1:1 B(i) = rand; end But thi...

7 years ago | 0

| accepted

Load more