Answered
How to check requested add-ons for particular models?
https://www.mathworks.com/help/simulink/ug/run-dependency-analysis.html can check dependencies for Simulink models.

3 years ago | 0

| accepted

Answered
Using two logical vectors to extract data
mean(A(3, A(1,:) == 2000 & A(2,:) == 1))

3 years ago | 0

Answered
how to have A and A' show 3x2 column vector
You will need to create a new class that is derived from double, and for the new class you will need to either change the vertca...

3 years ago | 1

Answered
How to correct "Undefined function 'mtimes' for input arguments of type 'cell'."
The mlx constructs 11 parameters starting from alpha1 . However the modelFile expects 12 parameters starting from theta0

3 years ago | 0

| accepted

Answered
On CodeHS I’m trying to solve 6.1.6, checkerboard, but I keep getting an error of an undefined variable on line 14, I wrote color_value = color_value + 1. Please help me
There is no MATLAB function named def . You could define such a function and take advantage of command/function duality. For exa...

3 years ago | 0

Answered
Synchronizing two matlab scripts on two devices
If the devices support RS232 and you have one of the increasingly-rare true serial ports, then you can use serialport() and conf...

3 years ago | 0

Answered
converting vector result into matrices for surf command
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1200898/with.txt'; with = readtable(filename); with...

3 years ago | 0

Answered
Finding the roots of a high degree equation?
You can increase the efficiency. syms z L n k EI p c p1 N Pi = sym(pi); n =20; sz_i = n; sz_j = n; Y = (1-cos((2*N-1)*Pi/2...

3 years ago | 0

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
A((dy*i)/dy1,(dx*j)/dx1) having a division in a calculation of coordinates is very often a problem. You can sometimes get away ...

3 years ago | 0

Answered
what is the fastest (high speed data transfer) way of connecting the Arduino due board (running a high speed motor) with Simulink for realtime data transmission and control?
Ethernet. For example there is https://docs.arduino.cc/retired/boards/arduino-ethernet-rev3-without-poe with an W5100 controll...

3 years ago | 0

Answered
How to determine the relationship between two variables from a plotted graph
You cannot reliably determine the relationship between the variables from a graph. Suppose you had a trial function N = f(M) . ...

3 years ago | 1

Answered
How to parse values from .txt/XML file?
S = fileread('CostFunc.txt'); parts = regexp(S, '(?<=Date>)(?<Date>[^<]+).*?(?<=Cost>)(?<Cost>[^<]+)', 'names'); Dates = dat...

3 years ago | 0

Answered
How to work Magdas data
Once you have read the data, create a timetable object, using the times as row times. Then you can retime specifying the regular...

3 years ago | 0

Answered
minimum distance between 2 objects
Trace the boundaries of the two objects. https://www.mathworks.com/help/images/boundary-tracing-in-images.html Then with the c...

3 years ago | 0

| accepted

Answered
Optimization of code with double for-loops
X = (l(:)-q(:).')*T; for loop = 1:length(t) t2(:,:,loop) = t(loop) - X; end replace with t2 = reshape(t, 1,...

3 years ago | 0

| accepted

Answered
How can I stop manually a true while loop?
Pressing control-C will interrupt a calculation, and there is no way to catch control-C to handle it smoothly. you could, each ...

3 years ago | 0

| accepted

Answered
convergent with order p = 1
T = 10.0; % Final time until which we compute N = [1000, 750, 500, 250, 100, 75, 50, 10]; % Number of time steps k = 5; m = 0...

3 years ago | 0

Answered
How can I smooth out my 3D graph?
Maybe just light it ? xvec = 0:12; yvec = 0:27; [x,y] = meshgrid(xvec, yvec); z=[0 0 0 0 0 0 0 0 0 0 0 0 0;0 -11 -14 0 0 0 ...

3 years ago | 0

Answered
Is there any way to use intel realsense mapping (SLAM) with matlab?
In R2022b, the code for helperDetectAndExtractFeatures starts at line 359 of MonocularVisualSimultaneousLocalizationAndMappingEx...

3 years ago | 0

Answered
How would this be solved
The tangent line of a curve has a tan() that is dy/dx, and it passes through the point of interest. Remember y = m*x + b and m =...

3 years ago | 0

Answered
How can I evaluate a complex definite integral?
You will need to switch to numeric operations. The definite integral involves polylog(2) and polylog(3) and the limit of those a...

3 years ago | 0

Answered
How to remove a value from a vector in a for loop?
candidates = 1:N; kidx = randi(numel(candidates)); k = candidates(kidx); candidates(kidx) = []; lidx = randi(numel(c...

3 years ago | 1

| accepted

Answered
how to use the result of current iteration as input for next iteration ?
for l=1: 10 %number of iteration for i=1:m xnew = zeros(1,n+1); for j=1:n R_lb(i,j)=BP...

3 years ago | 0

Answered
Factorial using a for loop
iteration 1, i=1, output is 1=1, =1*i iteration 2, i=2, output is 1*2=2, =1*i iteration 3, i=3, output is (1*2)*3=2*3=6, =...

3 years ago | 0

Answered
GENERATE CONDITIONS BETWEEN TWO ARRAYS AND RESULT IN A VALUE
condition1 = all(AA>=0 & AA<=5 & BB>=5 & BB<=10, 'all') The result of these conditions will be in a matrix called AABB You def...

3 years ago | 0

Answered
Create binary image from compressed domain values in text file
cutable = readtable ('frame1.csv'); % i,x,y,w,h,no.of bits carray = table2array (cutable); len = length (carray); idx = carra...

3 years ago | 0

Answered
when i try loading .dat file it gives the following error Input must be a MAT-file or an ASCII file containing numeric data with same number of columns in each row.
Line 50002 onward in the file has no initial coordinate, such as ,2.00E-17,7.80E-08 Try T = rmmissing(readmatrix('duty.dat'))...

3 years ago | 0

| accepted

Answered
How does the following loop turn out to be different from the expected 25?
Your inner loop is j=1:i . The first time that is j=1:1 . The second time it is j=1:2 . The third time it is j=1:3, then 1:4, th...

3 years ago | 0

Answered
Difference between imshow and mesh/surf
imshow() sets the axes YDir property to 'reverse' (unless "hold on" is in effect) Note that array row indices correspond to Y c...

3 years ago | 0

| accepted

Answered
Solving equation with two for loops
I suggest you switch to numeric solutions, and to providing solution hints. Some of the tests I did hinted there might be multip...

3 years ago | 0

| accepted

Load more