Answered
Suppression failure on evalin command
It would be much more simple and efficient to omit the indirection over |evalin|: i(1) = 1; See the excellent explanatio...

9 years ago | 1

Answered
Solve: floor(x/5) - floor(x/7) = 1 in Matlab
Okay, if this is not a homework, than you find enough information here to solve the problem already. I summarize: * Matt J sh...

9 years ago | 1

| accepted

Answered
Calculating the Greatest Common Divisor for two positive integers (simple)
You need a main function to call the functions: function main [A, B] = getData; G = GCD(A, B); % Do not call t...

9 years ago | 0

Answered
select elements of matrix from indices defined in an array
Nope, a loop is efficient here: A = [0.1299 0.3371 0.5285; ... 0.5688 0.1622 0.1656; ... 0.4694...

9 years ago | 3

| accepted

Answered
construct a lower triangular matrix with smaller matrices
A = [1 2; ... 3 4; ... 5 6]; B = tril(ones(4,3), -1); R = kron(B, A) R = [0, 0, 0, 0, 0, 0;...

9 years ago | 0

| accepted

Answered
hgexport prints not the complete figure
I don't define the axes position separately. I only use the option "Expand axes to fill figure" from the Export Setup. Th...

9 years ago | 0

Answered
cumsum reset back to zero every 100 times
s = cumsum(x); d = [0, s(101:100:numel(x))]; s = s - d(ceil((1:numel(x)) / 100)); Now s(101) is 0, which might match ...

9 years ago | 1

Answered
visible is not a property in class root
The error message occurs, if |h=0|: h = plot(1:10, rand(1,10)); pause(2); set(h, 'Visible', 'off') Works. But: ...

9 years ago | 1

| accepted

Answered
How to prevent imwrite from rounding my data?
TIFF images are not the best idea to store data in a high precision. You can use a 16-bit TIFF image, but a binary file might be...

9 years ago | 0

Answered
Performing matrix subtraction for huge data
Explain, what the actual problem is you are working on. It is not likely that you really need to create this output matrix expli...

9 years ago | 1

Answered
hourly mean for my data?
It is easier with the |datenum| format. Start with defining hours: Time = data(:, 1); % Hop this matches your data Hou...

9 years ago | 0

| accepted

Answered
About callback functions; If anyone can help I will appreciate
'uiresume(f5)' is a bad definition of a callback. Callbacks defines as strings are supported for a backward compatibility with M...

9 years ago | 1

Answered
Matlab 2016b command is black after Windows Update
I did not take a screen shot early enough, because I was sure to found the solution after the uninstalling was successful. But h...

9 years ago | 1

Answered
I cant append tables from a workspace variable to a file
|writetable| overwrites the formerly existing files. Using |fopen| *and* |writetable| interfere with each other. What about: ...

9 years ago | 0

Answered
Is there the more elegant way to do this?
*Not an answer*, but a comment concerning the discussion: This is another example for an inefficient debate: The group of exp...

9 years ago | 4

Answered
simplify(~(~(x | y) & ~(y | z)))
Remember these equivalences ( <https://en.wikipedia.org/wiki/De_Morgan%27s_laws De Morgan's laws> ): ~(x | y) <==> ~x & ~y ...

9 years ago | 1

| accepted

Answered
why am I seeing a bunch of characters when I open a m file?
If you open an M-file from a compiled application, the code is encrypted. They start like this then: V1MCC4000MEC1000MCR100...

9 years ago | 1

| accepted

Answered
Why does length sometimes read the number of columns instead of the number of rows?
Whenever you have a question concerning a command, start at the documentation: doc length or <https://www.mathworks.com/...

9 years ago | 1

Answered
Accessing variables in m file without executing it
I agree with Stephen, but have a slughtly more pessimistic opinion: No, it is not possible, at least not in the general case....

9 years ago | 0

| accepted

Answered
How can I compile a 32-bit app developed on 64-bit OS
This will not work, as you have found out by your own already: * AppDesigner introduced in 2016a. * 32 bit support stopped ...

9 years ago | 0

Answered
Cell contents reference from a non-cell array object error
Look at the code: X = handles.finishCell; mask = labeledImage; for i = 1 : numel(X) Y = X{i}.*mask; end ...

9 years ago | 0

Answered
How do I combine two DateNumber strings without resulting in all NaN values?
What about: s = {'2017-08-10 09:10:11'; ... '2017-08-10 09:10:12'; ... '2017-08-10 09:10:13'; ... '...

9 years ago | 0

Answered
Loop over modelruns and write out data
# Do not load variables directly into the workspace. On one hand this confuses the reader, because it is not clear whar a variab...

9 years ago | 0

| accepted

Answered
Maxflat function generates error message for certain condition.
I confirm that Matlab 2016b stops with this error. For other parameters the function works as expected, e.g.: [b,a] = maxfl...

9 years ago | 0

Answered
Data handling in GUI
It is a bad idea in general to create data in the base workspace. Such a remote controlled creating of variables is hard to debu...

9 years ago | 0

Answered
Attempted to access n0(500); index out of bounds because numel(n0)=1. Error in ANC_Algorithm (line 56) x(1) = n0(j);
for j = size(1:lin) This will most like not do, what you expect. It runs the loop over the 2 elements of the vector [1, li...

9 years ago | 0

Answered
cell2table not recognizing cell array
Matlab is case-sensitive. Some of the error messages contain an upper-case "T" in "cell2Table". Note that the error message does...

9 years ago | 0

Answered
unique() on a Nx1 cell array with different length vectors per cell
You can create your own function to find the unique cells: function uC = UniqueCell(C) % Reply cell array with unique el...

9 years ago | 2

| accepted

Answered
Problem with MATLAB "exist", returning 0, although the file actually exists!
If |exist()| cannot find the file, it does not exist in the current folder and the folder of Matlab's |path|. It can be very tri...

9 years ago | 1

Load more