Answered
How do I increase the number of columns displayed in the variables editor in the 2016 release
See bug report 1350885 <https://www.mathworks.com/matlabcentral/answers/296248-how-do-i-increase-the-number-of-columns-displa...

10 years ago | 0

Answered
Change variables of a matrix with conditions
X = [... 150,156,165,174,182,191,199,207,215,222,230,238,245,252,259,266,273;... 150,155,164,172,180,188,195,203...

10 years ago | 0

| accepted

Answered
conversion of hexadecimal timestamps
>> datevec(hex2dec('577aaa0e')/86400 + datenum(1970,1,1)) ans = 2016 7 4 18 ...

10 years ago | 0

| accepted

Answered
Hi, I'm trying to upload mutliple files into matlab but they are qxf files and I am struggling.
I will assume that the function <https://www.bodc.ac.uk/products/software_products/qxf2mat_function/ |qxf2mat|> imports the file...

10 years ago | 0

Answered
How to use matrix elements as indices to access elements of another matrix
>> S = size(Values); >> [R,C] = ndgrid(1:S(1),1:S(2)); >> X = sub2ind(S,R,C,Id); >> out = Values(X) out = 0 ...

10 years ago | 1

Answered
Keep m*n structure after indexing a matrix
How would you expect to keep the same "structure" (I guess you mean size) ? If the number of elements that the indexing operatio...

10 years ago | 4

| accepted

Answered
How to create a 2D lookUp table in matlab
You could use |interp2| or |interpn|: >> x1 = 0:0.1:1; >> x2 = 25:2:35; >> y = 0.01:0.001:0.06; >> vm = zeros(nume...

10 years ago | 2

| accepted

Answered
Using verbose produces error
MATLAB does not have any inbuilt function or variable named <http://www.mathworks.com/help/matlab/ref/verbose.html |verbose|>. D...

10 years ago | 0

Answered
Copy Figure prints the wrong figure
*Do not use |gcf|.* Use the handle of the plots that you created: fgh = figure(...) axh = axes(fgh,...) plot(axh,...)...

10 years ago | 0

Answered
Nested for loops newbie question
So you have some nested loops and you want to make your code faster. The first step is to read this page: <http://www.math...

10 years ago | 0

| accepted

Answered
Limited number of visible columns in Variable Viewer
See bug report 1350885 <https://www.mathworks.com/matlabcentral/answers/296248-how-do-i-increase-the-number-of-columns-displa...

10 years ago | 0

| accepted

Answered
How to I colour a scatter plot in relation to a third parameter?
The <http://www.mathworks.com/help/matlab/ref/scatter.html |scatter|> documentation has examples and explanations of how to do t...

10 years ago | 0

| accepted

Answered
How can I select a folder to save a set of images to?
Use <http://www.mathworks.com/help/matlab/ref/uigetdir.html |uigetdir|>. Or perhaps <http://www.mathworks.com/help/matlab/ref...

10 years ago | 1

| accepted

Answered
Hi, i'm trying to make a condition that states 'only if the difference between two values is greater than 0.1 then plot'. What would be the code for this? Thanks :)
NaN's are not plotted, so you just need to convert those values to NaN: >> V = [0,1,2,3,3.5,4,5,6,7,7.5,8,8.5,9,10,11,12]; ...

10 years ago | 0

| accepted

Answered
how to compare last n characters of many strings in matlab?
Use <http://www.mathworks.com/help/matlab/ref/regexp.html |regexp|>, you can wrap it in a <http://www.mathworks.com/help/matlab/...

10 years ago | 0

| accepted

Answered
"Activate" lines with a GUI?
This is easy using <http://www.mathworks.com/help/matlab/matlab_prog/nested-functions.html nested functions> (tested on MATLAB 2...

10 years ago | 0

Answered
Filter a struct based on the field name.
Rather than using a scalar structure and messy code with fieldnames, a far more efficient and simple approach is to use a <http:...

10 years ago | 1

Answered
What is the best way to handle huge number of variables when preparing a UI?
The smart and easy way would be to use |mat| files. |mat| files _are_ binary files, and since version seven have been compres...

10 years ago | 0

Answered
Is there a way to change Matlab colors to be easier on the eye?
To change the MATLAB editor / debugger colors: <http://www.mathworks.com/help/matlab/matlab_env/about-editor-debugger-prefere...

10 years ago | 1

Answered
Can you get more syntax colours ?
To change the MATLAB editor / debugger colors: <http://www.mathworks.com/help/matlab/matlab_env/about-editor-debugger-prefere...

10 years ago | 0

| accepted

Answered
bsxfun seems to return too few values
@Lachlan: this is a bug (or an undocumented "feature"), and you should report it. You can read how here: <http://www.mathwork...

10 years ago | 0

Answered
Output argument 'd' is not assigned on some execution paths.
What happens if detaPo is equal to zero? while (detaPo~=0) d = D; ... end then your function will never ent...

10 years ago | 1

| accepted

Answered
How to eliminate for-loop?
This gives the correct output, unlike the accepted answer: >> N = size(A,2); >> Cd = diag(C); >> G = bsxfun(@times,A....

10 years ago | 1

Answered
Data in array being overwritten when if statement is satisfied.
Your data is being "overwritten" because that is what you wrote your code to do: Cur2(1:n) = 0; puts zeros in elements 1 ...

10 years ago | 0

| accepted

Answered
Sorting a vector by another vector with same terms
*Method 1* using <http://www.mathworks.com/help/matlab/ref/intersect.html |intersect|>: >> intersect(B,A,'stable') ans =...

10 years ago | 1

| accepted

Answered
Getting the minimum value from a row vector
Why make it complicated ? >> a = [1,2,3,3,4,5,6,6,7,8,9,10]; >> b = sort(a); % guarantees the order >> for k = 1:nume...

10 years ago | 0

| accepted

Answered
Getting the minimum value from a row vector
a = [1,2,3,3,4,5,6,6,7,8,9,10]; f = find([1,diff(a),1]); x = f(2:end)-f(1:end-1); c = mat2cell(a,1,x); where ...

10 years ago | 0

Answered
Using the Probability to change values of variables
Like all tasks in MATLAB, this is much easier once you learn to think in terms of vectors and arrays rather than in terms of ind...

10 years ago | 0

| accepted

Answered
how can i write F=(1/N).*f.*double(a).*f; correctly, my ,matlab(2015a) keeps giving me errors
You are trying to multiply two arrays which have totally different sizes: >> a = rand(23,99,3); >> N = length(a); >> ...

10 years ago | 0

| accepted

Answered
Loading .mat file into a variable
It is simple to put the data into one cell array: % Save fake data: data1 = 1:3; data2 = 3:5; data3 = 5:7; data...

10 years ago | 1

Load more