Answered
How do I repeat a for loop for all columns?
With a _vectorized_ approach: n_steps = 1000; n_trials = 10000; x_pos = zeros(n_steps, n_trials); for k = 2:...

8 years ago | 0

Answered
make a GUI in matlab
This is exactly what Matlab's editor does already. Why do you want to re-create such a standard tool? But if you really want ...

8 years ago | 1

| accepted

Answered
How can I plot a triangle with its altitudes?
If the question is: "I'd just like to know whats wrong with my coding", this is the answer: x = [0,2,4,0]; y = [0,3,2,...

8 years ago | 0

| accepted

Answered
Loop for classifying variables is not working??????
If you want an output in every case, combine the |if| conditions: if x(1) > 31.5 && x(1) < 36.5 && x(2) >= 60 && x(3) >= 2 ...

8 years ago | 1

Answered
how to store for loop output for all iterations to a text file ?
fid = fopen(FileName, 'w'); if fid == -1 error('Cannot open file: %s', FileName); end for k = 1:1000 A = ra...

8 years ago | 0

| accepted

Answered
can you help me, to modify the parameters of the axes in matlab R2014a
ax = gca set(ax, 'XAxisLocation', 'top', ... 'YAxisLocation', 'left', ... 'XDir', 'normal...

8 years ago | 1

Answered
it is saying out of memory. Probably caused by infinite recursion?
Prefer to write correct comments. The input argument is not K but T, and only in the description of the output you mention, that...

8 years ago | 0

Answered
I am doing image analysis extracting boxes from an image and i am getting all the time a fatal error "Floating point exception"
Please post the code, at least the failing line. But even better: Follow the advice given in the message: This error was det...

8 years ago | 0

Answered
Stored array won't work when variable is greater then one
xrcoord(:,ca)=xrescoord yrcoord(:,ca)=yrescoord These lines let xrcoord and yrcoord grow in each iteration. Then re...

8 years ago | 0

Answered
Is it possible to Insall matlab 2018a on 32-bit platform
The last version of Matlab, which runs in 32 bit, is R2015b. All later Matlab versions are 64 bit versions. This means, that you...

8 years ago | 1

Answered
how to simplify/consolidate repeat functions
If you have a set of variables, store them in a cell array instead of of different variables. Then the processing in a loop is e...

8 years ago | 0

Answered
Evaluating an ODE until you reached a certain distance using a while loop: Train/distance problem
lookfor=y(1)+3 This stops at y(1) == -3, not +3. You want: lookfor = y(1) - 3;

8 years ago | 0

| accepted

Answered
Run external software from Matlab using system() with admin rights
You can try this: Create a file "LT_AsAdmin.vbs": Set UAC = CreateObject^("Shell.Application"^) UAC.ShellExecute "C:\......

8 years ago | 0

Answered
How to take first Character if name starts with specified string
While |regexp| is very powerful, |strncmp| is faster usually. C = {'STA.TH01E2RT00' 'STA.J01E2RT00R99' 'STA...

8 years ago | 0

Answered
How can I assign 2-lines of a text input to a single array row?
What about a simple |fscanf|? fid = fopen('nodes_brick.txt', 'r'); Data = fscanf(fid, [repmat('%g,', 1, 8), '%g'], [9, i...

8 years ago | 1

| accepted

Answered
Is it possible to add a new colulmn to an already predefined uitable in Matlab GUide?
Yes, the CellSelectionCallback sounds fine, if you want to apply the operation, when a cell is selected: function YourCellS...

8 years ago | 0

Answered
I got such an error while running this code.
Beside the stiffness of the system, it can be a pole in the trajectory also. Try it by stopping the integration shortly before t...

8 years ago | 0

Answered
How to set up Runge Kutta Simulation for Numerical Vehicle Dynamics?
It depends how your RK4 code is written. Remember that you have to convert the higher order equation to a system of equations of...

8 years ago | 0

| accepted

Answered
Euclidean distance for 3D data
I guess, that you want the distance of a set of points to a specific other point: % 100 points in 3D: Pos = rand(100, 3)...

8 years ago | 2

| accepted

Answered
problem with nested function in GUIDE
The required format is clear: The main functions and nested function must be closed by an "end": function main functio...

8 years ago | 0

| accepted

Answered
Error using rk4sys (line 2) at least 4 inout argument required
How do you call this code? You have posted it in one block. (By the way: Use the "{} Code" button to apply a proper formattin...

8 years ago | 1

| accepted

Answered
read the text file in matlab gui as same formate
I not sure, what the problem is. It would be helpful if you mention, which problem you observe. Maybe |fscanf(fid, '%s')| imp...

8 years ago | 0

Answered
How to get multi-line text in GUI edit text ?
To convert the GUI element from a "single line edit control" to a "multi-line edit control", set "Max-Min>1", see <https://www.m...

8 years ago | 3

| accepted

Answered
How to display whos y in GUI edit text or static text ?
The actual problem is: set(handles.edit7, 'String', CStr); but i get the following warning : Warning: Single line Edi...

8 years ago | 0

| accepted

Answered
what can cause for internal errror?
Internal errors are caused by internal problems. This sounds, as the reasons are not known externally, e.g. by a public forum, m...

8 years ago | 1

Answered
Why does my code for shooting method using 'ODE45' or 'ODE23s' does not converge to the boundary value.?
You want to get: f'(infinity)=0, t(infinity)=0, p(infinity)=0 but you integrate on the interval [0, 10]. 10 is not infini...

8 years ago | 1

Answered
How do I search through a character array with another character that has optional words?
A simple loop might work: Search = {'banana', 'apple'}; found = true; for k = 1:numel(Search) if isempty(strfin...

8 years ago | 0

Answered
Error using fseek Invalid file identifier. Use fopen to generate a valid file identifier.
After formatting (using the "{} Code" button...), your code looks fine: filePatternu = fullfile(myFolder, 'test*.dcm*'); ...

8 years ago | 0

| accepted

Answered
Output a variable each time step using ODE45
The idea of a "previous time step" in the execution of ODE45 is not meaningful. Remember that the integrator adjusts the stepsiz...

8 years ago | 2

| accepted

Answered
long execution time for simple lines like end and vector value addition
A very important part of the code is missing: Is |Efoot| and |Esk| pre-allocated properly? Otherwise the arrays grow iteratively...

8 years ago | 0

Load more