Answered
error in calculate coefficient
Like the error message says: error : Out of memory. The likely cause is an infinite recursion within the program. Error in res...

4 years ago | 0

Answered
search string in array that contain other arrays
Maybe this: for ii = 1:numel(logic_list{1}.phases) if contains(logic_list{1}.phases{ii}.state,'G') % do stuff ...

4 years ago | 1

| accepted

Answered
how to calculate by tol and while loop
Your while loop might have a structure like this: tol = 1e-12; err = Inf; n = 1; while n <= 200 && err > tol % get new ...

4 years ago | 0

Answered
SAVE MATRIX WHILE I SHOULD GET 121 BY 10 AS THE NO OF ITERATIONS SHOULD BE 10 ONLY NOT 11
On the last iteration, t is not exactly equal to tf; it is very close but still a little less: ti=0; dt=0.1; tf=1; t=ti; % i...

4 years ago | 0

Answered
How to change the Excel Sheet name in loop
I think the only thing you need to change is your syntax in calling xlsread() o = 1; while o<25 Y1 = xlsread("Excelname.x...

4 years ago | 1

| accepted

Answered
What is the current version of Matlab?
R2021b is the current version https://www.mathworks.com/products/matlab/whatsnew.html

4 years ago | 0

| accepted

Answered
latex interpreter sprintf issue
Since there is a backslash (for the latex format) inside the sprintf format string, you must escape it (i.e., put another backsl...

4 years ago | 3

| accepted

Answered
Why does a for loop 1:1:n index at a different rate than +1?
Look what happens when you pass a non-scalar array to fprintf(): Z = [1; 2; 3]; fprintf('the value of Z is: %f',Z); The entir...

4 years ago | 1

| accepted

Answered
Add Gaussian Noise to a Signal
65 dB is a high enough SNR that you can't tell the difference visually between a signal with no noise and a signal with noise 65...

4 years ago | 0

| accepted

Answered
Offset must be a double error when reading file byte by byte
I think you've got the second and third inputs to fseek() swapped around. It should be fseek(fileID,offset,origin), so for insta...

4 years ago | 1

Answered
Transposing the output of writecell
You can make a 2D cell array of size n_max-by-n_vectors, where n_vectors is the number of vectors in C and n_max is the length o...

4 years ago | 1

| accepted

Answered
bodeplot(), setoptions - YLabel, How to set?
rng("default") sys = rss(5); h = bodeplot(sys); ylabel_opts = getoptions(h,'YLabel') % set only the magnitude plot ylabel st...

4 years ago | 1

| accepted

Answered
For loops and Arrays
Do you mean like this row vector: [30 45 30 45 30 45 30] repeated N times going down? Something like that? If so, you could l...

4 years ago | 0

Answered
Is the calculation of the median including outliers?
Let's do a test to try to figure it out: rng(2); data = randn(1,10); figure(); plot(data) med = median(data); med_no_outli...

4 years ago | 0

| accepted

Answered
How do I map a 4x4 string matrix to a 4x4 set of edit fields?
A lot of details are not clear, but something like this may give you an idea of the structure you might end up with. [And there ...

4 years ago | 0

Answered
Indices on left incompatible with those on right
I can't say whether the math regarding Bezier curves here is right or wrong, but the MATLAB error is from attempting to assign a...

4 years ago | 1

| accepted

Answered
How to open csv files as separate numeric matrices from a certain directory?
% csv_location = 'path\to\your\csv\files'; csv_location = ''; files = dir(fullfile(csv_location,'*.csv')); for ii = 1:numel...

4 years ago | 0

| accepted

Answered
I'm getting a Error using get, Unrecognized property String for class Root. in my program, all I what is to hit the push button and have no problem.
On this line: handles.height= str2double(get(handles.height,'string')); You are getting the 'String' property of the uicontrol...

4 years ago | 0

| accepted

Answered
Parallel computing with switch case function
Well, you can run it in parallel by using a parfor loop instead of a for loop (if you have the Parallel Computing Toolbox). But...

4 years ago | 0

| accepted

Answered
How to change a for loop code to run over columns instead of rows?
Seems like you can, with a couple of pretty minor modifications, get the code to work for either case (i.e., when participant_co...

4 years ago | 0

| accepted

Answered
How to create XML file without the first line of <?xml version="1.0" encoding="utf-8"?>
You could do something like this, which first writes the xml file as usual (with the first line) using xmlwrite(), then reads th...

4 years ago | 0

| accepted

Answered
How to get Points(x,y) from function
t = [0.01:0.01:2*pi] B = 1.75 T = 0.18 P = 1.1 C = 0.11 E = 0.8 R = 0.0 X = @(t) 0.5 + 0.5*(((abs(cos(t))).^B)./cos(t)) ...

4 years ago | 0

| accepted

Answered
Identify & Removing Linear Dependent row/s
How about this? Matrix = [10,-7,1,4,6;-8,4,-6,-10,-3;-7,11,-5,-1,-8;3,-1,10,12,12] [~,p] = rref(Matrix) removed_column_idx = ...

4 years ago | 0

| accepted

Answered
How to make the zplane function to plot on a existing axes?
I don't think you can do that with zplane(), but you can, in your own axes, fairly easily reproduce the lines that zplane() crea...

4 years ago | 1

Answered
Hello, how can I create a matrix for the following figure in MATLAB?
Something like this? It takes more than one matrix to do it. [X,Y] = meshgrid(0:0.025:2.15,0:0.025:1.925); idx = X < 0.5 & Y >...

4 years ago | 0

| accepted

Answered
Getting error about input argument
It looks like you are attempting to use the function mySMOTE() with your data by putting values into the definition of the funct...

4 years ago | 0

| accepted

Answered
Invalid Expression. Check for missing or extra characters.
Add ellipses (...) to the ends of lines when you want to continue the statement to the next line: clc; clear; tic n = 360...

4 years ago | 0

Answered
Matrix of two columns using two vectors
A = [1,2,3,4]; B = [5,6,7]; LA = length(A); LB = length(B); Matrix = zeros(LA*LB,2); for i = 1:LA for j = 1:LB ...

4 years ago | 1

| accepted

Answered
GriddedInterpolant of two variables
Yes: %Defining the Gravity Correction Table for Lattitude Corrections x = [20 21 22 23 24 25 26 27 28 29 30]; y = [0;5;10;15;...

4 years ago | 1

| accepted

Answered
I want to use the interp2 command, but because my points are non-uniform, it gives a non-uniform error. How do I do interpolation using 5 points in a 2D space?
Example using a scatteredInterpolant with 5 points in 2D space: I = scatteredInterpolant([1;2;3;4;5],[3;5;2;1;1],[100;200;200;1...

4 years ago | 0

| accepted

Load more