Answered
How to get rid of Warning"Unexpected use of '[' in a scalar context."
Use |all| or |any|, like this: if all(A==[1,3,3]) Or right-click the pop-up warning box and follow the instructions to s...

8 years ago | 0

| accepted

Answered
How can I solve "Transpose on ND array is not defined. Use PERMUTE instead."?
The variable |slp| has three dimensions. Either: * Change |slp| so that it is a matrix. * Change your code to use <https://w...

8 years ago | 0

| accepted

Answered
How do I save the distance using imdist function and then perform additional calculations?
_" I'm not entirely sure how I can use the imdist to save the distance that I'm interested in and then perform additional calcul...

8 years ago | 0

| accepted

Answered
Label with num2str
xlabel({'effective stress',['ID=',num2str(Id)]})

8 years ago | 1

| accepted

Answered
How can I organize my data into 12 rows of different lengths?
I would put the data into a cell array, because it is easy to to import the data and split it into a cell array, it makes access...

8 years ago | 0

| accepted

Answered
Convert Array to Text File
Your approach is very inefficient: you don't need a loop, you certainly don't need |evalc|. It is much more efficient to use the...

8 years ago | 2

| accepted

Answered
Need Help Forming a Matrix from an Array
You could use <https://www.mathworks.com/help/matlab/ref/hankel.html |hankel|>. Where |A| is your 4051x1 array: hankel(A...

8 years ago | 1

| accepted

Answered
Read in files with loop
Simpler to use indexing and |fullfile|: D = 'C:/Users/Ben/Desktop/'; S = dir(fullfile(D,'*_equil')); % where is the file...

8 years ago | 0

| accepted

Answered
Textscan difficulties opening file.
Something like this will get you started: opt = {'Delimiter','\t','HeaderLines',1,'CollectOutput',true}; fmt = '%s%f%f%f...

8 years ago | 0

| accepted

Answered
Interpolate matrices for different times in Matlab
Simpler in just one line and more efficient without all of those intermediate variables: >> a(:,:,1) = [1 1 1;2 2 2;3 3 3];...

8 years ago | 0

| accepted

Answered
What makes a Toolbox a Toolbox, and how is it recognized by Matlab?
@Chad Greene: As far as I can tell: * <https://www.mathworks.com/discovery/matlab-apps.html Apps> are based around one graphi...

8 years ago | 4

| accepted

Answered
How to read files from sub folders in sorted order?
The simplest solution is to download my FEX submission natsortfiles, which was written to solve exactly the problem that you are...

8 years ago | 0

Answered
what is the difference between right and left eigenvector?
<http://mathworld.wolfram.com/Eigenvector.html> <https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors#Left_and_right_ei...

8 years ago | 0

Answered
How do you send to multiple email addresses using this code? I am launching from the edit window not the command window?
Call the |Recipients.Add| method as many times as you need to (e.g. in a loop). Or else separate the addresses using a semi-c...

8 years ago | 0

Answered
Rearranging Bytes in a Cell
This is easy with <https://www.mathworks.com/help/matlab/ref/regexprep.html |regexprep|>: >> C = {'00 11 22 33 AA BB'}; ...

8 years ago | 0

| accepted

Answered
Read numbers and characters
Using a simple text file (this will be much easier than processing an Excel file): >> str = fileread('temp0.txt'); >> st...

8 years ago | 0

| accepted

Answered
Why accessing 2d matrix in parfor so slow?
_"How can I speed this up?"_ # Do you have a parallel pool open? I.e. created using <https://www.mathworks.com/help/distcomp/...

8 years ago | 1

Answered
How can I store 10 strongest points of surf features of multiple images in one variable using matlab?
Just use a cell array and indexing: D = 'mypath'; S = dir(fullfile(D,'*.jpg')); N = numel(S); C = cell(1,N); fo...

8 years ago | 1

| accepted

Answered
combine between numbers and characters in one vector
The simplest solution is to simply mark the number of repetitions for _all_ values: this requires the least processing and can b...

8 years ago | 1

| accepted

Answered
Transformation form char to double
You need both <https://www.mathworks.com/help/matlab/ref/strrep.html |strrep|> and <https://www.mathworks.com/help/matlab/ref/st...

8 years ago | 4

| accepted

Answered
Hello, I need to plot a large number of sub-arrays from one large array.
Just use a loop and some very efficient indexing, something like this: A = randi(1e6,2181305,1); % fake data R = 1:5000;...

8 years ago | 1

| accepted

Answered
How to load variable in a nested structure from file
Accessing the data without knowing the name of the variable is easy, as long as there is only _one_ variable saved in the |.mat|...

8 years ago | 0

| accepted

Answered
How can I multiply each row of a matrix with every row of another matrix elementwise?
bsxfun(@times,permute(A,[1,3,2]),permute(B,[3,1,2])) or using MATAB R2016b and newer: permute(A,[1,3,2]) .* permute(B,...

8 years ago | 1

| accepted

Answered
how to convert empty double into zeros
if isempty(Quad) Quad = zeros(1,31); end

8 years ago | 1

| accepted

Answered
Copy cell array with syntax
Try looking on MATLAB File Exchange for submissions, e.g.: <https://www.mathworks.com/matlabcentral/fileexchange/61093-class2...

8 years ago | 0

Answered
How do i change specific values in a matrix/image
This is exactly what <https://www.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|> is for. You will need something like thi...

8 years ago | 1

Answered
Downloading codes and running code
_"Whenever I download a code I get a number of m format files after extracting that."_ First step: extract the files to the M...

8 years ago | 0

| accepted

Answered
How to use callbacks to plot data from an existing matlab data file?
<https://www.mathworks.com/help/matlab/function-handles.html Function handles> are <https://www.mathworks.com/help/matlab/matlab...

8 years ago | 1

| accepted

Answered
Each matrix of the of the cell should be unique/different from each other
One way: use a 3D array, shuffle each matrix so that it is unique: n = 2; r = n+1; z = zeros(r,n,5); z(1,:,:) = 1;...

8 years ago | 1

| accepted

Answered
How to split long string into group and cut off the excessive string.
Easy in one line: >> aaSeq = 'MQKSPLEKAGVLSKLFFSWTRPILRKGYRQRLELSDIYQIPSADSADNLSEKLEREWDRELASKKKPKLINALRRCFFWRFMFYGILLYLGEV...

8 years ago | 1

Load more