Answered
Error: The vector returned by ODE_VIERTELFAHRZEUG_LABOR and the initial conditions vector must have the same number of elements
You are creating the "Sinus-Sweep" for a long time interval in each iteration. You need the value at the time t (from the input!...

5 years ago | 0

| accepted

Answered
Draw a curve in matlab figure
figure; x = linspace(0, 2*pi, 1000); y = sin(x).^2 + sin(x / 2).^2 .* x / 10; plot(x, y)

5 years ago | 0

| accepted

Answered
pathdef.m is not run at startup?
Do not store anything in Matlab's bin folder. If you click "Set Path", Matlab loads the first pathdef.m file, which is found in...

5 years ago | 0

| accepted

Answered
find a row number in text file for certain condition
data = [1.2;1.0;0.05;0.4;0.3;0.2;0.1;0.05;0.04;0.03;0.03;0.02;0.01;0.001;0.01;0.01;0.001 ] ; [b, n, index] = RunLength(data < 0...

5 years ago | 1

| accepted

Answered
Concatenation of nested cell in one array and writing in text file
Data = load('nestedCell.mat'); C = cat(2, Data.nestedCell{:}); FID = fopen('YourFile.txt', 'w'); fprintf(FID, '%-8s%g\n', C{:...

5 years ago | 0

| accepted

Answered
Literally convert decimal to string
If the values are stored as floating point numbers in double or single format, they do not have trailing zeros. Trailing zeros a...

5 years ago | 1

| accepted

Answered
How can i loop this code?
Faster: Omit the clear all. It removes all loaded functions from the memory. Reloading and parsing them from the slow disk waste...

5 years ago | 1

| accepted

Answered
how to use Event function to stop the simulation when certain condition is true with ode15s?
Insert these lines: function [value,isterminal,direction] = saturation(t,C) Rtot = 2E-6; % In the other function: Rtot = 1.8...

5 years ago | 0

Answered
Is it possible to vectorize this ?
AB = A(:, B); result = sum(AB, 1) ./ sum(AB ~= 0, 1); mean('omitnan') replaces the NaNs by zeros for the summation and cal...

5 years ago | 1

Answered
Filter a signal by chunks
There is no perfect method to get the initial values of the filter in the general case. One option is to filter the signal backw...

5 years ago | 0

| accepted

Answered
How to kill an executable ran by system command and close the cmd window
You could try to start the executable through Java instead of opening a CMD window: runtime = java.lang.Runtime.getRuntime(); ...

5 years ago | 1

| accepted

Answered
How do I solve this error?
The error message means, that the variable LoptTemp has been defined as function handle before. A pre-allocation solves the pro...

5 years ago | 0

| accepted

Answered
How does MATLAB implement the : operator?
The colon operator tells Matlab to use the complete array or dimension. Then Matlab does not have to test, if the indices are in...

5 years ago | 0

| accepted

Answered
Deleting an image in an image array doesn't appear to be working
What is an "ImSpinner"? I do not find it in the documentation. What is an "image array"? I guess, it is a cell array. Then: ap...

5 years ago | 0

| accepted

Answered
Why are these two ways of writing the same integral giving me different results?
integral() calls the function with a vector as input. Then norm() calcuates the matrix norm in the 1st function, while the 2nd f...

5 years ago | 0

Answered
Cannot set Visual Studio 2017 as default compiler in Matlab 2017a
MathWorks has mentioned a bug, which requires a patch. But this seems to fix a problem with the message "NMAKE: fatal error U105...

5 years ago | 0

Answered
Euler's Method system of odes
You determine the derivatives: % dx/dt = 1/D*x % dy/dt=(1/C)*(A-(B*y)-x) Now x(i+1) and y(i+1) are not the values of these de...

5 years ago | 1

Answered
Symmetric Matrix-Vector Multiplication with only lower triangular stored
Plese check if this is efficient in your case: A = rand(5, 5); A = A + A'; % Symmetric example matrix B = tril(A); %...

5 years ago | 2

| accepted

Answered
Can not pass enough input arguments to BVP function using bvp4c
In the line: sol=bvp4c(mat4ode,mat4bc,solinit); you call mat4ode without inputs. You want to provide the function handle inste...

5 years ago | 1

Answered
Why can't I use Java in startup.m?
I assume, that Java is not running completely at this time. I'm working with different Matlab versions at the same time and inse...

5 years ago | 0

| accepted

Answered
Splitting an array?
Data = C{1,1}; Len = size(Data, 2); Half = floor(Len / 2); Part1 = Data(:, 1:Half); Part2 = Data(:, Half+1:Len); It is ...

5 years ago | 0

| accepted

Answered
Undoing a strsplit function
The easiest way is to store a copy of the original data. Then nothing has to be undone.

5 years ago | 0

Answered
How can I get a function existing in a matlab version which I don't have on mine?
You need to buy the license and install the toolboxes.

5 years ago | 1

| accepted

Answered
.m file to bin file
There is no definition of bin-files. You can read any file in binary mode and M-files are simply text files. Therefore it is not...

5 years ago | 0

Answered
Hi, what could be the error in this program?
Instead of converting the CHARs to doubles and searching for 32, and converting back to CHARs, you can search for the space dire...

5 years ago | 0

Answered
Merging 2 or more Txt Files with same Column Number into a new Txt file
This is easy in Matlab: FileList = {'File1.txt', 'File2.txt', 'File3.txt'}; DestFile = fullfile(tempdir, 'JoinedFiles.txt'); ...

5 years ago | 0

Answered
Extra white spaces not inserted using the text command
Yes, of course. The LaTeX interpreter ignores spaces. It is intented to do so. Use the LaTeX command \hspace{} for horizontal b...

5 years ago | 1

| accepted

Answered
extract without change my NaN value
Let's simplify the code at first: for i=1:32 for j=1:20 SPI3_SM(:,i,j) = nnz(CHIRPS_SPI3_SM(:,i,j)<-1 & CHIRPS_SP...

5 years ago | 0

Answered
sscanf missing first zero
No, sscanf considers the leading zeros. But numbers are stored in double format in Matlab (and other programming languages as we...

5 years ago | 0

| accepted

Answered
Using output variables from one function as inputs for another
If the variables "days" and "daily_deaths" are output of the function process_data(), you have to catch the outputs: [days, dai...

5 years ago | 0

Load more