Answered
Hi Guys! I want to compute annual means of returns based on monthly returns. So I have 363 monthly returns vector and want to compute the following sequence mean(1:12), mean(13:24), mean(25:36)....and so on.
You seem to assume, that something is wrong with your code. Then please mention, why you think so. This is better than letting t...

8 years ago | 0

| accepted

Answered
How can I password-protect functions and scripts
I'm using a hash inside the M-files. See <https://www.mathworks.com/matlabcentral/fileexchange/31272-datahash FEX: DataHash> or ...

8 years ago | 0

Answered
Step-back button in GUI
After the colors have been converted to gray, there is no way to get the colors back. But of course you can store the initial va...

8 years ago | 0

| accepted

Answered
How to make directories within directories within directories
Use absolute paths for the folders. You cannot create a subfolder using the |mkdir(parent, sub)| notation, if |parent| is not fo...

8 years ago | 1

| accepted

Answered
how to check if a line segment intersects a circle
Calculate the distance between the line and the center of the circle: P1 = [-2, -2]; % Point 1 of the line P2 = [2, 2];...

8 years ago | 2

| accepted

Answered
Error: Invalid MEX file, the specified module could not be found
This means, that a library is missing. See <https://www.mathworks.com/matlabcentral/answers/92362-how-do-i-determine-which-libra...

8 years ago | 0

Answered
How can I avoid ellipsis in checkbox GUI?
Checkboxes do not accept multi-line text. But you can create a checkbox *without* a string, and set a multi-line text right besi...

8 years ago | 0

| accepted

Answered
A triangular creation in a matrix with the rest zeros
you do not have to run the loop from 1 to n, but only until all rows have been created. n = input('Enter a number'); s...

8 years ago | 1

| accepted

Answered
How do I create multiple for loops depending on the array size?
As in the answers you find in Stephen's links: Use an index vector instead of a list of |for| loops. Replace: arr = [a1 a2 ...

8 years ago | 1

| accepted

Answered
error using mex function
The error messages are clear: You try to store a |mwIndex*| in a |int*|, but you cannot expect, that they are compatible. The...

8 years ago | 0

| accepted

Answered
How to speed up matrix operations with lots of scalar constants involved ?
If you have a modern Matlab version >= 2016b, use the auto expanding instead of an explicit |repmat|: % Ipc = repmat(I(:,jt...

8 years ago | 0

| accepted

Answered
Is there a way to "handle" the ANOVA boxplot ?
You have mentioned the best solution already. FigList = allchild(groot); [lSp, lStbl, lSstats] = anova1(leftA); FigHa...

8 years ago | 1

Answered
Can you help me please , to resolve this erreur in matlab
The error message means, that in your code for i=1:M the variable |M| is a 'full 4d real' (although I do not know, what ...

8 years ago | 0

Answered
explanation of logical condition?
By the way: In (i < 4-[size((A(k).cdata),1)]) the square brackets are confusing only. |[]| is the operator for concatena...

8 years ago | 1

Answered
I have a problem in my code
The error message sounds clear: Maximum function count exceeded; singularity likely Check, if there is a singularity in ...

8 years ago | 0

| accepted

Answered
Read a nested json file.
Do you know |jsondecode|? str = '{"results":{"whatever_name":{"id":77},"another_name":{"id":89},"another_name":{"id":60}},"...

8 years ago | 0

Answered
How Vectorize operation?
I cannot really follow your description. Do you want the lowest value for all elements of column 8, which have the same index in...

8 years ago | 0

Answered
Finding particular R, G, B value by comparing with threshold and fetching its corresponding pixel locations from table
None of the colors in the table satisfies B <= 100. What ever the relation between the two tables is and whatever "corresponding...

8 years ago | 0

Answered
How to convert MATLAB Scripts to JSON ?
The question is not meaningful: While a Matlab script contains executable code, a JSON file is though to store data. Of course y...

8 years ago | 0

Answered
finding the index of row
While the solution has given by Majid Farzaneh already, remember, that comparisons with floating point values are sensitive for ...

8 years ago | 0

Answered
Please help me, where must i do for this problem is gone. I want to configure mingw 64 to matlab.
The error message is clear: The current folder is |C:\WINDOWS\system32\|, but there the file |myMexFile.c| is not found. Use ...

8 years ago | 0

Answered
Arranging a matrix rows with respect to another matrix
Does this what you want? [~, order] = sort(sum(A, 2)); B2 = B(order, :)

8 years ago | 0

Answered
what's the difference between writing 1.0 and 1. or 2.0 and 2. ?
While 1. and 1.0 create completely equal values of type |double|, the abbreviated notation is not documented. I asked MathWorks'...

8 years ago | 1

Answered
Expand to find inner boundary of object
Is the "outer boundary" of the points the convex hull? If so, you can determine the points on this hull at first. Afterwards you...

8 years ago | 0

Answered
How to access text files from many subfolders within a folder?
mainFolder = 'D:\FEMA_P695_Far_Field_Long'; % Use absolute paths mainList = dir(mainFolder); subFolder = {mainList([ma...

8 years ago | 4

Answered
How do I collaborate on matlab?
Is this meaningful? What do you want to happen, when 2 persons modify the same line of code? Even if different lines are modifie...

8 years ago | 0

Answered
How to find the max if 4 variables?
v1 = rand; v2 = rand; v3 = rand; v4 = rand; maxValue = max([v1, v2, v3, v4]); minValue = min([v1, v2, v3, v4]...

8 years ago | 1

Answered
Axis fontsize and text fontsize not matching
lbl = 'These two labels should have the same fontsize 10 yet appear with different sizes' ; figure('position', [100 100 700...

8 years ago | 0

Answered
uitable autofill without cursor jumping to cell (1,1)
Perhaps this helps: <https://www.mathworks.com/matlabcentral/answers/348905-programatically-selecting-cells-in-a-uitable> [ED...

8 years ago | 0

| accepted

Load more