Beantwortet
how to count the total number of recursion ?
The problem is that you're not passing |num| to |collatz|, so how can it know how many times it has been called? Here is a versi...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
Add values to a Matrix
If you're trying to collect all the values for the inner loop ( |for i=1:fil| ), you could try putting M = []; above the...

fast 11 Jahre vor | 0

Beantwortet
Plotting 10 graphs with different colors and markers
There is a table in <http://www.mathworks.com/help/matlab/ref/linespec.html LineSpec (Line Specification)> with 13 different mar...

fast 11 Jahre vor | 0

Beantwortet
Unnest a Matrix of strings
If I understand what you're trying to do, you can't do it. A 3x3 matrix of strings looks like this: ['abc';'def';'ghi'] ...

fast 11 Jahre vor | 1

Beantwortet
Simple question about plotting a convolution
Your code will give you a vector of length |length(y1)+length(y2)-1|, so you'll get an error if you plot it against |x| (which i...

fast 11 Jahre vor | 0

Beantwortet
Inner matrix dimensions must agree.
Note the top error statement: Inner matrix dimensions must agree. Have you tried testing these functions with vector arg...

fast 11 Jahre vor | 0

Beantwortet
Help on sign function argument
Use 2*sign(x-0.01)-1

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to Create Libraries in Matlab?
The simplest approach would be to put the functions in their own folder and add that folder to the <http://www.mathworks.com/hel...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
Make Smooth Curves using the points
The reason your points are not connected is that you are plotting them one at a time. You need to create some vectors and plot t...

fast 11 Jahre vor | 0

Beantwortet
How to reproduce MATLAB's normal distribution random numbers?
I did a quick search, and found <https://github.com/numpy/numpy/issues/2047 Patch with Ziggurat method for Normal distribution (...

fast 11 Jahre vor | 0

Beantwortet
Calculation from user input with blank cells
The answer depends on how you would calculate the ratio |Mo| for fewer gears. If, say, the user omits Gear 3, do you want to sim...

fast 11 Jahre vor | 0

Beantwortet
how to find the minimum value based on two independent value
I'm going to assume you're really trying to minimize a function of two variables and show how you can explore it to get some ins...

fast 11 Jahre vor | 0

Beantwortet
Issue finding numerical error (problem with MATLAB's precision?)
That pesky MATLAB - getting more accurate all the time! Here is an example that I got from the blog article <http://matlabgeeks....

fast 11 Jahre vor | 0

Beantwortet
Add folders and subfolders to projrct through script
See <http://www.mathworks.com/help/matlab/ref/mkdir.html mkdir>.

fast 11 Jahre vor | 0

Beantwortet
Accessing Cell Array elements
I'm not sure I understand all the details of what you are trying to do, but I can show you with an example how to modify the sec...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
symbolic cubic polynomial solver
I ran the same code and got 3 solutions: syms x a xsols = solve(x^3+x^2-x+a,'real',true); size(xsols) ans = ...

fast 11 Jahre vor | 0

Beantwortet
what is the equivalent matlab function for the operator || || ?
You're probably referring to the <https://en.wikipedia.org/wiki/Matrix_norm matrix norm>, which is a generalization of the idea ...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Subscripts in MATLAB Legends
I'm beginning to think you should submit a bug report. However, maybe you'll get more consistent results with h=legend('$e_...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
How is it possible that matlab solves two simultaneous equations which have relation to each other? I am very new with matlab and can not get it done. I want to solve several equations with the euler method bot always get errors.
You could just write Pg = 1; but a better way, since you know how large the vector will be, is to preallocate the memor...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How Can I establish a raking scale of variables within an array?
Your ranking scheme is somewhat unusual because usually the ranking does not have any gaps in it. That would be easy to implemen...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Matrices with Polynomial Entries functions
Maria, is the matrix inverse your goal, or are you using it for some other purpose? A common mistake is to solve a linear equati...

fast 11 Jahre vor | 0

Beantwortet
Use dynamic "offset" in a for-loop
It would be better to use a |while| loop to increment |t| directly: t = window; while t < numel(m) % increment t ...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Stop permanently execution of codes under a Callback using another Callback
Reena, have a look at <http://www.mathworks.com/matlabcentral/answers/101649-how-can-i-interrupt-a-callback-and-not-come-back-to...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Extract certain rows from matrix
Assuming you read the other data file into |another_matrix|, the answer is extracted_data = another_matrix(loc); I sugge...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How can I plot using a string in MATLAB?
It's not necessary to have all those conditional statements. Just use indexing: function plotting_fcn(idx) % Note: idx cou...

fast 11 Jahre vor | 1

Beantwortet
Is it possible to solve a pair of two equations for four unknowns
Since the answer is not unique, just pick x=y=1 and solve the linear equation to get A and B: [12.12 2.35; 8.55 6.44]\[6.20...

fast 11 Jahre vor | 0

Beantwortet
Amplitude adjustment on integral
Just calculate the integral (see <http://www.mathworks.com/help/matlab/ref/integral.html integral>), say q = integral(fun,x...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
LaTeX interpreter on a legend
You could try setting the interpreter to LaTeX: legend(ar, 'Location','best','Interpreter','latex') For this to work...

fast 11 Jahre vor | 1

Beantwortet
Index out of bounds
The variable name |filename| is probably |char|, not numeric. Suppose you define filename = '12'; Then if you view the s...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
inflection point on sum of sinusoids
If you define a vector A = [A1 A2 ... An], and analogous vectors |w| and |p|, then in MATLAB y = sum(A.*sin(w*t+p)); and...

etwa 11 Jahre vor | 1

| akzeptiert

Mehr laden