Answered
lotka-voltter method euler
Running this code in each iteration is a waste of time: figure(2),plot(t,y(1),'b.',t,y(2),'r.'); hold on; xlabel('time') y...

8 years ago | 0

Answered
Debug and Focus, Huh?
I'm using a tool under Windows, which let the focus follow the mouse: WizMouse. This is useful for scrolling in background windo...

8 years ago | 1

Answered
xmlwrite - Control the order of attributes
It is the nature of XML files, that the order of the attributes do not matter. Therefore I expect, that there is no way to deter...

8 years ago | 1

| accepted

Answered
Passing who function output as input
As mentioned already, this approach is extremely prone to bugs and unexpected behavior. As soon as someone calls a variable "tab...

8 years ago | 0

Answered
Recieving error Index exceeds the number of array elements (93) when attempting to useODE45?
There are a lot of severe problems in your code. One of them: function vp = Code1(t,v) ... k=max(size(t)); You call this as ...

8 years ago | 3

| accepted

Answered
Capitalizing every word in a string
I like simple Matlab code: m = [false, isspace(str)]; m = m(1:length(str)); str(m) = upper(str(m)) By the way, tes...

8 years ago | 1

| accepted

Answered
How to use xlswrite with cell arrays in a loop?
for k = 1:10 Range = [char('a' + k - 1), '1'] xlswrite('Example.xls', AA{k,1}, 'Sheet1', Range) end The conversion t...

8 years ago | 1

| accepted

Answered
license erro -9,57
Does Walter's list solve your problem? https://www.mathworks.com/matlabcentral/answers/404028-license-error-cheat-sheet Most o...

8 years ago | 0

| accepted

Answered
Linkaxes causes change in current figure based on figure visibility. How to link the x axes without current figure changing?
Instead of setting the current figure by: set(0,'CurrentFigure',figs(2)) and relying on the hope, that the current fuigure is ...

8 years ago | 1

| accepted

Answered
"Warning: Unable to load Toolbox Path Cache" during parallelization
If the path cache is updated by multiple threads, it is likely, that one thread tries to read the file, while it is re-created b...

8 years ago | 0

| accepted

Answered
Direct form 2 iir filter
See https://www.mathworks.com/matlabcentral/answers/9900-use-filter-constants-to-hard-code-filter#answer_13623 for a Matlab func...

8 years ago | 0

| accepted

Answered
Why am I getting the following errors
This is strange: dS = @(t, x, s) (dSV(t,x) - x(2)*dV(t,x))/x(5); dP = @(t, x, p) (dPV(t,x) - x(3)*dV(t,x))/x(5); dG = @(t, x,...

8 years ago | 1

Answered
Global variable keeps initialising again and again when I want it to only initialise once.
Avoid globals. As you can see already, they confuse programmers and impede the debugging. Do not use globals. For tiny codes glo...

8 years ago | 1

| accepted

Answered
I would like help to plot a graph where on the x-axis are hour and minute data and on the y-axis are the temperature data
Fine. What is your question? If you have the dates as numerical datenum values, use datetick (link). For datetime objects, use ...

8 years ago | 0

Answered
1:2:10100:-25:0 gives 1, how?
See: Answers: Puzzling syntax: 2:4:8:10:12: 1:2:10100:-25:0 is correct Matlab syntax, but might be interpreted unexpectedly. It...

8 years ago | 5

| accepted

Answered
How can I build a menu like this?
If you create a popup menu in GUIDE, selecting a row will call the corresponding callback. Then you can start what ever you want...

8 years ago | 0

Answered
Pdist2 inside for
Why? pdist2 works directly with providing a [M1 x N] and a [M2 x N] matrix. So why do you want to write a loop and process one m...

8 years ago | 0

| accepted

Answered
Index exceeds matrix dimensions.
See my answer to your former question: https://www.mathworks.com/matlabcentral/answers/439728-solving-a-system-of-ode-over-diffe...

8 years ago | 1

| accepted

Answered
Create n number of figures in MATLAB GUI.
The easiest way is not to use GUIDE or the AppDesigner, but to create the figures programmatically. See FEX: 41 GUI examples, fo...

8 years ago | 1

Answered
How to set the range of X axis equal to a column vector
ax2 = axes('Position',ax1_pos,... 'XAxisLocation','top',... 'XLim', [0.8, 1.35], ... 'XDir', 'reverse', ... ...

8 years ago | 0

| accepted

Answered
order 20 highest values of a pagerank vector
Use the 2nd output of maxk also: [M, index] = maxk(pagerank, 20) Result = x(index, :) I assume, you want maxk of the page...

8 years ago | 0

Answered
How can I write a parfor loop with nested variable?
The error message is clear: You use "x" as a variable and a function. Simply use different names. By the way: It is a very bad ...

8 years ago | 1

| accepted

Answered
How to read a specific row in a txt-file with variable row length?
"For a project I would like to read a certain row of the txt-file constant_file_matlab.txt" function S = ReadLineOfFile(FileNam...

8 years ago | 0

| accepted

Answered
matfile operating very slowly: how to improve performance?
You explain, that the use of the matfile command is slow, but the shown code does not contain this command at all. If you access...

8 years ago | 0

Answered
How to create a transparent, rectangular patch with rounded corners?
A rectangle object does not have XData and YData properties and it does not allow to set the transparency by Alpha blending. Thi...

8 years ago | 0

Answered
2D Random Walk Please Explain What These For Loops Are Doing
The question is not really clear. You can read in the documentation, what the for command does: doc for But maybe you ask for ...

8 years ago | 0

| accepted

Answered
How to draw horizontal line in my yaxis using my existing code
What exactly is "a (min,max) horizontal line from y axis"? The posted code does not help to understand, what you are asking for....

8 years ago | 0

| accepted

Answered
How to find 3 unknows with Least square a*cosh(b*x)+c, not using toolbox?
You have a system of equations: a * cosh(b * x) + c - y = 0 with x and y are the given. Now you search the least-squares-solut...

8 years ago | 0

| accepted

Answered
How to solve Error using == ?
i = find(t > 0.1); M = max(v(i, 4)); iM = find(v(:, 4) == M); This fails if no t is greater than 0.1. Then i is empty and M...

8 years ago | 0

| accepted

Answered
Help me with imwrite
I guess boldly: b = reshape(b, size(a));

8 years ago | 0

| accepted

Load more