Answered
How do you write -0 in an array on matlab?
Note that according to standard definitions <https://en.wikipedia.org/wiki/Signed_zero minus zero> has the same _value_ as posit...

11 years ago | 0

Answered
Displaying the progress of a factorial as a vector.
>> n = 6 n = 6 >> cumprod(n:-1:1) ans = 6 30 120 360 720 720

11 years ago | 0

| accepted

Answered
Definitely a newbie. When entering functions at the command line, how do I go back to lines above and correct syntax errors??
You can't go back and "correct" what has already been run. Think of the text in the command window as being a _record_ of what y...

11 years ago | 0

| accepted

Answered
Why do i keep getting that the inner matrix dimensions must agree? i trying to plot this equation vs time but it keeps giving me this error, even if i use the '.*t' format
Converting the <http://www.mathworks.com/help/matlab/ref/mtimes.html |mtimes|> to a <http://www.mathworks.com/help/matlab/ref/ti...

11 years ago | 0

Answered
Comparing Values in 3D Matrix
Just use <http://www.mathworks.com/help/matlab/ref/diff.html |diff|> with its optional |dim| argument: Y = abs(diff(X,1,3))...

11 years ago | 0

| accepted

Answered
I have a folder with 1500 images. I need to process the first 200 images(ie, 1 to 200). I used for loop it. But when i run the code i starts from 1,2,3 ... 100. then instead if going for 101th image, its value changes to 1001 , 1002... and so on.
You have discovered ASCII sorting is not the same as human sorting. The easiest solution is to use my FEX submission natsortfil...

11 years ago | 0

| accepted

Answered
Multiply plot joined together
Here is a demonstration of how to create three (or an arbitrary number of) plots vertically joined together: % Fake data: ...

11 years ago | 0

| accepted

Answered
HI I was trying to brighten grayscale image with I=rgb2gray(A) J = imadjust(I) . For some reason it was not working. Can anyone please tell me if there any other way? thanks
Actually <http://www.mathworks.com/help/images/ref/imadjust.html |imadjust|> can also brighten images, you just need to supply t...

11 years ago | 2

| accepted

Answered
Finding a series of numbers in a vector which correspond with a series of numbers in a different vector.
The most efficient way is to write <http://www.mathworks.com/help/matlab/matlab_prog/vectorization.html vectorized code>: Y...

11 years ago | 1

| accepted

Answered
how to solve an equation of the form ax=b
Use <http://www.mathworks.com/help/matlab/ref/mldivide.html |mldivide|>: _"Solve systems of linear equations |Ax = B| for |x|"_

11 years ago | 1

Answered
Access to a table, why matlabs run with code: T = T(:,[varnames(others) 'SelfAssessedHealthStatus']); , but later can not run with this one: T(:, ['Systolic' 'Diastolic']) = [];
The problem is that you misunderstand the meaning of <http://www.mathworks.com/help/matlab/ref/specialcharacters.html square bra...

11 years ago | 0

| accepted

Answered
Help with removing duplicate sub-elements....
Use <http://www.mathworks.com/help/matlab/ref/isnan.html |isnan|> and <http://www.mathworks.com/help/matlab/ref/diff.html |diff|...

11 years ago | 0

| accepted

Answered
How can I find and substract only these values from a dataset which are bigger than a threshold?
xnew = mod(x+180,360)-180

11 years ago | 1

| accepted

Answered
how to get max, min and avg of a field of a structure in a cell matrix
I would suggest that you convert your data in a <http://www.mathworks.com/help/matlab/matlab_prog/access-multiple-elements-of-a-...

11 years ago | 3

| accepted

Answered
how to pick element by element
Why not just use logical indexing: >> A = magic(3) A = 8 1 6 3 5 7 4 9 2 >> A(A>3) = 0 ...

11 years ago | 0

Answered
How do I assign a function output (in the form of a vector) to a field for a vector of structures?
% Create non-scalar struct from cell arrays: name = {'CO2','CH4','NO2','Lin_gas'}; preV = { 200, 200, 200, 200};...

11 years ago | 0

| accepted

Answered
how can i find same values in an array?
This identifies _all_ matching rounded values, unlike the accepted answer: b = round(a(:)); c = bsxfun(@eq,b,b.'); x ...

11 years ago | 2

Answered
Write a loop which will sum an array until the sum exceeds an 'n' value?
You increment |c| inside the |while| loop, but never check its value. So no matter how many times your code increments the value...

11 years ago | 1

| accepted

Answered
Selecting an element from each column of a matrix using another matrix
Use <http://de.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|>: >> A = [0,1,2;3,4,5;6,7,8;9,10,11] % your matrix A...

11 years ago | 0

| accepted

Answered
Fitting Polynomial Curve for 4,000 curves.
ord = 2; data = [1:7;20:23,25,26,25;21,24,23,23:26]' num = size(data,2)-1; cof = cell(ord+1,1); for k = 1:num ...

11 years ago | 0

Answered
Trailing string input error using rowfun
The problem is that you are supplying *multiple* inputs to <http://www.mathworks.com/help/matlab/ref/sum.html |sum|>, but |sum| ...

11 years ago | 0

| accepted

Answered
how to create two counter loops that run at the same time in matlab??
This loop: for m = 1:16 n = 1+mod(m-1,4); disp([m,n]) end displays the variables |m| and |n| in the com...

11 years ago | 1

| accepted

Answered
How to address a Matrix by not using the Indices?
First some trial data: >> M = [1,2,3;4,5,6;7,8,9] % data M = 1 2 3 4 5 6 7 8 9 >> rV = ...

11 years ago | 0

Answered
Resize 4-dimensional matrix, possible?
Try <http://www.mathworks.com/help/matlab/ref/interpn.html |interpn|>, which interpolates any number of dimensions.

11 years ago | 0

| accepted

Answered
Why does 'filesep' not work with 'gcb'?
This is a very broad question, because it depends entirely on what _operations_ you wish to perform on that string: do you wish ...

11 years ago | 2

Answered
Counts in each bin for 2d histogram ?
Have a look at these functions: <http://www.mathworks.com/help/stats/hist3.html |hist3|> <http://www.mathworks.com/help/ma...

11 years ago | 0

Answered
read image from different folders?
This should get you started: S = dir('*.2016'); D = [S.isdir]; N = {S(D).name}; V = datenum(N,'dd.mm.yyyy'); [~...

11 years ago | 0

| accepted

Answered
1d interpolation from multiple text files
Although beginners love using numbered variables and think that using numbered variables will solve all of their problems _they ...

11 years ago | 2

| accepted

Answered
How to store matrices elements to cell array?
This is trivial using <http://www.mathworks.com/help/matlab/ref/num2cell.html |num2cell|>, _once the arrays are concatenated tog...

11 years ago | 0

Load more