Answered
Running uisetcolor Crushes my Compiled application
Try to use another color chooser, e.g.: https://www.mathworks.com/matlabcentral/fileexchange/91615-matlab-uicolorpicker

5 years ago | 0

Answered
Comma separated function output requests
Why do you expect A to be the empty cell? The right hanbd side is the scalar 30: S = struct('type', '()', 'subs', {{3}}); x = ...

5 years ago | 1

Answered
my matlab is not opening
THis might mean that the preferences are damaged. They are store in a folder in your user folder. If you tell us, which OS you a...

5 years ago | 0

Answered
how to get which button was pressed?
You can provide the index as additional argument of the callback: 'Callback', {@buttonPushed, iR, iC}, ... function butt...

5 years ago | 0

Answered
How to protect arbitrary variable names
I you work on a larger project (any code with > 20 lines), avoid scripts. They are a shot in your knee. With using functions, th...

5 years ago | 1

Answered
how to filter out decimals
function s = Fnkt(n) if n <= 0 || n ~= floor(n) s = 0; return; end syms k x s = symsum(k,k,0,n); end Do you re...

5 years ago | 0

| accepted

Answered
Matlab code for accessing different folder data
Folder = 'C:\Base\Folder\'; FileList = dir(fullfile(Folder, '**', 'YourFile.xlsx')); Data = cell(1, numel(FileList)); f...

5 years ago | 0

Answered
how can I get a y value for a chosen x value.
yDesired=y(index, :); % ^ But this gives you the trajectory and all but the last derivative. To get "all equat...

5 years ago | 0

| accepted

Answered
how to find the order of convergence
The convergence of the Newton methods depends on the initial value. There is no general order of convergence. For some start val...

5 years ago | 0

Answered
Multithreading library in matlab
No. You can use the command parfor and spmd, but this does not match the C++ threads exactly.

5 years ago | 0

Answered
How can I improve the parfor performance in my code?
Move all repeated calculations out of the loop: C1 = wnkcosDir.*spec_dfdt.*romega; C2 = wnksinDir.*spec_dfdt.*romega; C3 = wn...

5 years ago | 1

| accepted

Answered
Error: Too many output arguments
The function myRand replies to variables, which are assigned to the variables x and s. In the line [a,s]=x you try to assign th...

5 years ago | 1

| accepted

Answered
Select specific files from subfolders
Folder = 'C:\Your\Folder'; SubFolderList = {'C3', 'C6', 'C8', 'C9'}; for iSub = 1:numel(SubFolderList) File = fullfile(Fol...

5 years ago | 0

| accepted

Answered
How to create a programme that will increase its increment of the size of array with a push button ? Using GUIDE
With some guessing: function pushbutton1_Callback(hObject, eventdata, handles) Value = get(handles.listbox1, 'Value'); Data ...

5 years ago | 0

| accepted

Answered
1×0 empty double row vector with command find
Why do you call this an "error"? The vectors h_1 and h_2 do not have an equal element at the same location. h_1==h_2 is an eleme...

5 years ago | 0

Answered
How to delete multiple elements from array in step by step process and how to store remaining elements in array
A = [1 0.2 7 0.5 3 8]; nA = numel(A); array = cell(nA, 1); for k = 1:nA array{k} = maxk(A, nA - k + 1); end

5 years ago | 0

Answered
I need Correct Subplot for This Code
counter = 0; for i=Arrayinput for j=Arrayinput ... counter = counter + 1; subplot(alength, alen...

5 years ago | 1

| accepted

Answered
sketch the graph of the function: f(x,y)= 1+2x^2+2y^2
fsurf(@(x,y) 1 + 2 * x.^2 + 2 * y.^2)

5 years ago | 1

Answered
for loop multiple variables
Maybe: f = zeros(numel(u), numel(v)); for i = 1:length(u) for j = 1:length(v) f(i, j) = sum(q.*((u(i) - x).^2) + ((v(j...

5 years ago | 0

Answered
Allocate and acces filtered signal in struct
I guess, that you get an error. I cannot check this by my own, because I do not have your input data. ecg_raw = data(:,3); now...

5 years ago | 0

| accepted

Answered
How to realize linear function (filter?) with saturation?
u = [ones(15,1);-ones(5,1)]; Ramp = 0.1:0.1:1; % Set of values v = SaturatedRamp(u, Ramp); function v = SaturatedRamp(u...

5 years ago | 0

| accepted

Answered
four summation containing loop
Use the debugger to stop the code, when a NaN occurs: dbstop naninf Then run your code again. It stops in the first iteration,...

5 years ago | 0

| accepted

Answered
Vectorizing loop over multidimensional data
Some further improvements: WSUM = zeros(1,numW); L1 = U*V.'; % M x M L2 = (K*K.').^(-1/2); % M x M L5 = exp(1i * K.' * Wp);...

5 years ago | 0

| accepted

Answered
ODE 45 Error in line 256 and line 343
For me your code works fine, but it is very slow. I've inserted some simplifications: 0.123*10^(-8) is an expensive power opera...

5 years ago | 0

| accepted

Answered
Algorithm for the matrices
Either collect all Y in a 3D array: N = 10; A1 = [4/7, 7/4, 0; 7/4, 4/7, 0; 0, 0, 0]; A2 = [3/4, 1, 0; 1, 3/4, 0; 0, 0, ...

5 years ago | 0

| accepted

Answered
Why saving a figure in pdf makes a dot much bigger than it is?
plot(4.5,-0.27619,'k.', 'LineWidth', 20, 'MarkerSize', 20) % Omit the line width: plot(4.5,-0.27619,'k.', 'MarkerSize', 20) ...

5 years ago | 0

| accepted

Answered
How to exit from loop function ?
Simply try it: a = 0; for j = 1:10 fprintf('j=%d a=%d\n', j, a); if j < 3 a = 5; elseif j < 6 a = 2; el...

5 years ago | 1

| accepted

Answered
I can't get this bungee jumping model to run properly using RK-4 method. Can anyone list help me? It has a lot of errors in the program.
Code blocks like this are not useful, but confusing only: for i=1:n+1 if (w(1,i)-length)<=4.88 k(i)=150; else ...

5 years ago | 1

Answered
Dot indexing is not supported for variables of this type
vel = importdata(...) does not create the output vel as a struct in your case. I assume ".sto" files are text files. Then t...

5 years ago | 0

Answered
error using dlmread (line 62)
The command: dlmread('bottleneck_caserne/b200_combined.txt'); searchs the folder "bottleneck_caserne" in the current folder. C...

5 years ago | 0

Load more