Answered
Why has the locale changed in R2022a?
I find this in the release notes of R2022a: External Language Interfaces MEX Functions: UTF-8 system encoding on Windows platf...

3 years ago | 2

| accepted

Answered
How do i check if elements from my rows of vector are within range of one another
With some bold guessing of what you want to achieve: X = [ 0.2734, 0.1734; ... -0.1671, -0.2671; ... 0.0753, 0.0...

3 years ago | 0

| accepted

Answered
How to concatenate columns of varying lengths, generated by a for loop, into a matrix?
Maybe all you need is: Node_CONC = nan(200000,num_sim); THETA_ObsNode = nan(200000,num_sim); FLUX_ObsNode = nan(200000,n...

3 years ago | 0

| accepted

Answered
How can I down-sample the large matrix size in constant period of times?
The distance between 1 and 30 is 29, while it is 30 from 30 to 60. I you want the elements 1, 31, 61, ... use: Y = X(1:30:end)

3 years ago | 0

| accepted

Answered
Name a variable using an already existing variable
Creating names of variables dynamically is one of the question, asked most frequently by beginners in this forum. The experts gi...

3 years ago | 1

| accepted

Answered
UIPUTFILE Documentation Innaccurate/Change Warning Dialog?
I agree, that the text of the documentation is misleading. "Select a file to append or choose a new file" does not match the pu...

3 years ago | 0

Answered
Struct information string extraction
[] concatenates the CHAR vectors to one big CHAR vector and the result is expected. If you want a cell string, use curly braces:...

3 years ago | 0

| accepted

Answered
Freqz Command Resulting in Position 1 Invalid Index
The problem is mentioned in the error message already: "'freqz' appears to be both a function and a variable. If this is unint...

3 years ago | 0

Answered
Need help creating a matrix with unknown amount of rows.
The error message is clear: The variable "c" is not defined. Maybe "hyp" is the wanted variable? Please post code as text, beca...

3 years ago | 0

| accepted

Answered
Find automatically data of interest
Some methods are "ugly": load 'conv_ageing_atm5_m60p80_01to2048s_bif_74165.txt' Loading data directly into the workspace creat...

3 years ago | 0

Answered
Questions about infinity in matlab
Welcome to the world of the IEEE754 floating point format. This is not used only in Matlab, but in many other programming langua...

3 years ago | 1

| accepted

Answered
Max-min of a matrix column over rows where other columns have given values
In addition to my comment: max(x)-min(x) expressed as range(x): Nrows = size(A, 1); Npars = 9; Nouts = 11; effect = zeros...

3 years ago | 1

| accepted

Answered
Profile Total time vs timeit
The profiler disables (at least parts of) the JIT, the just in time optimization. This happens, because the JIT can reorder comm...

3 years ago | 0

Answered
While loop does not give me back the value
for h = 1:length(framesToRead) i=1; while i<length(h) The while loop is not entered. h is a scalar, so length...

3 years ago | 0

Answered
fprintf modifying txt file in the wrong way
You can replace: f_fil=fopen('material.inp'); s=fscanf(f_fil,'%c'); fclose(f_fil); by s = fileread('material.inp'); readli...

3 years ago | 0

Answered
how to use eval function in order to get the value of variable with fieldname ?
Why do you want to do this by the evil eval? See: TUTORIAL: how and why to avoid Eval . Beginners tend to try to solve problems ...

3 years ago | 1

| accepted

Answered
Calculate the orbit of the earth and moon around the sun using ODE45
Append an initial location and velocity for the moon also to yzero. The forces acting on the moon are the sum of the force from...

3 years ago | 0

Answered
Where can I find my MATLAB executeable files if I installed it to /home/Documents?
This seems to match your problem: https://www.mathworks.com/help/matlab/matlab_env/start-matlab-on-linux-platforms.html If yo...

3 years ago | 0

Answered
Can somebody show me how to fix these errors I am getting in my script?
You define the function as a CHAR vector. In the function root_myroot() you try to evaluate this vector as a function. But becau...

3 years ago | 0

Answered
How to call one of the outputs of the function?
[phi_ave_x, phi_ave_y, phi_ave_z] = crk4_aee321_Lorentz(xi,yi,zi,dt); disp(phi_ave_y) This uses the 2nd output phi_ave_y as in...

3 years ago | 0

Answered
I want to get an input number (N) and create as man as input number (N) empty different named matrixs. How to do such a thing?
N = input(); m = cell(1, N); Now use m{1} instead of m1. This is easier and faster. Creating variables dynamically is the que...

3 years ago | 1

| accepted

Answered
Delete rows from cell array in a for loop
C = num2cell(magic(4)); n = height(C) for k = 1:n C2 = C; C2(k, :) = []; ... your calculations come here end ...

3 years ago | 0

| accepted

Answered
Click button uifigure callback function
This looks strange. I do not see the reason for the error. Is this really the complete error message? Use the debugger to check...

3 years ago | 0

| accepted

Answered
GUI app callback functions problem
I'm not sure if I understand, where in the code the problem occurs. Waiting for a figure to be closed is done by the waitfor fun...

3 years ago | 1

| accepted

Answered
Find the desired row in the matrix
While removing multiple rows is easy using the unique(x, 'rows'), I did not find a built-in functions to identify the vectors, w...

3 years ago | 1

| accepted

Answered
sort each row of a vector according to its value
You do not need a function, because this is staight indexing: a = [1 3 10 5]'; b(a) = a b must be undefined or empty before t...

3 years ago | 1

| accepted

Answered
Solve the ODE using ODE45 and plot the response for the initial conditions
If you call a function "ode45", it depends on where its folder is located in Matlab's path, if it is used or the original ODE45 ...

3 years ago | 0

Answered
Please ask the code
You overwrite the value of m multiple times: m=3; m=0.1; m = linspace(0,0.001); Because projfun is a nested function, it use...

3 years ago | 0

Answered
Ignore rows in cell with no delimiters
You want the output: B = {a1} {1} {a2} {2} {a3} {3} {a4} {a5} {a6} {6} This is not possible. A cell matrix is still a m...

3 years ago | 0

Answered
How to create for and if loops instead of while
WHILE and FOR loops are equivalent: k = 1; while k <= 100 ... k = k + 1; end and for k = 1:100 ... end

3 years ago | 0

| accepted

Load more