Answered
Error of binary operator '/' not implemented for 'scalar' by 'function handle' operations
It's unfortunately difficult to give you a way forward other than: find the bugs in your code. Probably, the first bug is you...

10 years ago | 1

Answered
How to minimize a function without using a loop
It doesn't look like your Lag is much of a constant if there's 4000 values for it. Does Lag changes with R (since there's also 4...

10 years ago | 1

Answered
Directly using Index of max value without storing
This is one of the downside of matlab's syntax. It is not possible to chain expressions that use anything but the 1st return val...

10 years ago | 0

| accepted

Answered
Can I get a link to Matlab 32-bit?
If you log into your account, you can download past releases from the license manager. R2015b is the latest version that is 3...

10 years ago | 1

Answered
Why do complex matrices display real elements as "1.23e45 + i" when format is set to eng?
I can reproduce it with 2016a and 2016b pre. It is clearly a bug which I'll report to mathworks.

10 years ago | 0

| accepted

Answered
naming of a variable
_" i can't use array for this."_ *Yes you can, and you should*. The array can be a cell array. You could also use a <https:...

10 years ago | 0

Answered
How to create comparison matrices "comparing" arrays from an struct array with 4 columns and N rows?
To transform your structure to the cell array format you had in your <http://uk.mathworks.com/matlabcentral/answers/295871-how-t...

10 years ago | 0

Answered
error: The object invoked has disconnected from its clients.
[Pedantic] The error certainly has nothing to do with VBA since there's no VBA involved. You're using COM automation to talk to ...

10 years ago | 1

| accepted

Answered
Summing daily precipitation values into monthly totals using a for loop
Using a for loop is a complete waste of time and using multiple if inside the loop even more. |accumarray| is indeed the answer....

10 years ago | 0

Answered
Data type conversion in struct fields
I know nothing about simulink. Ideally, there would be a similar function to |get_param| that return the evaluated value of the ...

10 years ago | 0

Answered
append table to a exist csv file
You cannot use |dlmwrite| or |csvwrite| to write tables. You would have to convert the table to a matrix (using |table2array|). ...

10 years ago | 3

Answered
how to find max and min values of the plot
You can get the axis range from its |XLim| and |YLim| properties, which you can query with either |get(gca, 'YLim')| or simply |...

10 years ago | 0

Answered
How to get an output from a callback function?
_"I am trying to get the CurrentPoint of the mouse extracted outside of my WindowButtonDownFcn"_ But what does that mean exactly...

10 years ago | 0

Answered
How to convert a ASCII character to matrix
_I would like to use 'char' to create a database of all characters and symbols_ I don't think you understand what this means. A ...

10 years ago | 0

| accepted

Answered
Database toolbox downloading individual data as cell arrays
I don't have the database toolbox but I assume it returns the contents of a table as a cell array because there is no guarantee ...

10 years ago | 0

Answered
Calculate the difference between two points extracted from a loop?
Assuming |a| is a vector of 0 and 1 exclusively. Finding the index of each 1 immediately following a zero is trivial: compute th...

10 years ago | 0

| accepted

Answered
Why do I get the error: "Attempt to reference field of non-structure array"?
_"Is there an easy way to make this conversion"_. If _this conversion_ refers to converting an empty double into an empty struct...

10 years ago | 0

| accepted

Answered
How to write own standard deviation function.
Adam hit the nail on the head in his comment. You're reading a jpg image so most likely the |im| array and thus |R| is of type |...

10 years ago | 0

| accepted

Answered
change the background of image plotted using imagesec
Note that every time you call |colorbar| you create a new colorbar that replaces the previous one: colorbar ...

10 years ago | 0

| accepted

Answered
Multiple element at same index
Use a <http://www.mathworks.com/help/matlab/matlab_prog/create-a-cell-array.html cell array>: y = {0, -4, -2, [0, 2, 4], 0} ...

10 years ago | 0

Answered
Does loadMNISTImages(filename) accept filename.m ?
I don't really understand what you mean by _"using [LoadMNISTImages] with .mat format"_. It's obviously designed to load a parti...

10 years ago | 0

| accepted

Answered
Grouping similar pixels in bins
Use <http://www.mathworks.com/help/images/ref/imquantize.html |imquantize|>: binnedimage = imquantize(grayimage, 15:16:255)...

10 years ago | 0

| accepted

Answered
How to draw rectangle on a figure, based on mouse location?
For 1, create an anonymous function that binds the window size to BPP_mouseMove (with an added input argument). For 2, keep t...

10 years ago | 0

| accepted

Answered
How to concatenate (take cross product of) two datetime arrays?
This avoids conversion to datenum: Date = [datetime(2016,4,5), datetime(2016,5,4), datetime(2016,6,7)]; Time = duration(...

10 years ago | 0

Answered
How to sum every 29 data and make some condition for them?
For your moving sum, use <http://www.mathworks.com/help/matlab/ref/movsum.html |movsum|> (available since r2016a, before that us...

10 years ago | 3

| accepted

Answered
How to populate datetime object with one month´s dates for every minute?
d = datetime(2016, 6, 1) : duration(0, 1, 0) : datetime(2016, 6, 30, 23, 59, 0);

10 years ago | 0

| accepted

Answered
extract submatrix from a large matrix using loop
Use <http://www.mathworks.com/help/matlab/ref/mat2cell.html |mat2cell|> m = rand(1140, 330); %demo matrix splitm = mat2cel...

10 years ago | 0

Answered
Saving multi excel sheets to one in MATALB
files=dir('*.xlsx'); [~, sheets] = xlsfinfo('Result.xlsx'); sheetcontent = cellfun(@(sh) xlsread('Result.xlsx', sh), she...

10 years ago | 0

Answered
how to concatenate structure fields
Use a double |for| loop, then: m = zeros(numel(s(1).f(1).d), numel(s(1).f(1)), numel(s)); %preallocation is advised for ...

10 years ago | 1

Answered
Count each histogram in ascending order
It took me a while to understand your example (that you meant that 20 was the histogram count for bin 0) because 0:20 has a very...

10 years ago | 0

Load more