답변 있음
Topographic map with gradient vector
You can look at this: https://www.mathworks.com/help/matlab/creating_plots/display-quiver-plot-over-contour-plot.html

3년 초과 전 | 0

답변 있음
Using DisplayName Within a Loop
col_sim = {'-ro', '-bs', '-*k','-gx'}; % symbols for each curve of the plot (simulated data) col_exp = {'ro', 'bs', '*k',...

3년 초과 전 | 0

답변 있음
finding the mean based on a specific value in other column
You can find the rows with the first condition and the other rows for the second condition. The intersection of the two rows, ar...

3년 초과 전 | 0

| 수락됨

답변 있음
Why does my output turn out like this certain times I run my code?
in the first if statement, add a simi-colon ath the end: if (a>b) limit = b; end Also, you can simplify the firs...

3년 초과 전 | 0

답변 있음
Function is not working
coror = relor + (relor - 180).*(relor > 90) + (relor + 180) .* (relor < -90);

3년 초과 전 | 0

| 수락됨

답변 있음
frequency based on dictionary
you can use unique function along with badOfWords https://www.mathworks.com/help/textanalytics/ref/bagofwords.html

3년 초과 전 | 0

답변 있음
What is the process in converting 45 mps to mph on matlab?
x = input('MPH value? '); % check 3.6? is it correct? y= x*3.6; printf ('kilometer per second %f\n',y) z=x.*2.23694; fprint...

3년 초과 전 | 0

답변 있음
How can I assign a value to variable using buttons?
fig = uifigure; Bolt1 = uibutton(fig,'Text', 'Bolt 1','Position',[50,380, 100, 22],'ButtonPushedFcn', 'button_state=1;button_st...

3년 초과 전 | 0

답변 있음
Loop Updating Vectors for Number of Iterations
Simply use A = [3 2 3; 5 5 6; 9 8 9]; b = [1; 2; 3]; x=b; for k=1:200 x=A\x; end

3년 초과 전 | 0

답변 있음
how to correctly get values for stress for Y >82 values should be close to zero at Y = 88.25
You can use vectorized if statement: Q = Q2 .* (Y >= 82) + Q1 .* (Y < 82); stress = abs(V.*Q)/(i*t);

3년 초과 전 | 0

| 수락됨

답변 있음
How do I write a script that calculates and prints all values ​​for N according to the following expressions and limits?
N=1; % sum function uses an internal loop % find the first N that sum is >= 1.6 while sum(1./[1:N].^2) < 1.6 N = N+1; e...

3년 초과 전 | 0

답변 있음
After a certain time for loop speed slow down?
You can create A without having two nested loops: E0=10; [km, jm] = meshgrid(1:1000, 1:1000); A= E0*exp(-65*((km - 500).^2 +...

3년 초과 전 | 0

답변 있음
Setting up equation with variables without values
Use (1/2)*Lp % instead of 1/2Lp

3년 초과 전 | 1

답변 있음
Bisection method in matlab
clc clear lc=3; lp=3; w=160; T= 700; f=@(d) (w*lc*lp/(d*sqrt(lp^2-d^2)))-T; xl=input('enter the value for Xl '); xu=input(...

3년 초과 전 | 0

답변 있음
How to find the index of the variable in my For Loop when a condition is met
[~,ind] = find(diff(nr)==0) % print indices for i = ind fprintf("%d is adjacent to a number of equal value\n", i) end

3년 초과 전 | 0

| 수락됨

답변 있음
How to find the index of the variable in my For Loop when a condition is met
Use [nf, ind] = find(nr == i); ind contains the index with the given condition

3년 초과 전 | 0

답변 있음
How to plot the figure using Matlab ?
You can combine four plot commands or use four curves (lines) to plot it for example plot([0,1],[1,0],'r', [1,2,4,8],[0,-1,-2,...

3년 초과 전 | 1

답변 있음
how to fit a signal using polynomial fit with hogher order?
try polyfit function: polyfit function

3년 초과 전 | 0

답변 있음
How can i run my integer number from this question ?
You can convert the strinng to a double number then apply int8 or int16: int16(str2double(inputLetter))

3년 초과 전 | 0

답변 있음
error using plot vectors must be the same length
try to use this line of code inside the loop. For now, the code returns a single point for error; for i=2:test_points x_rec(...

3년 초과 전 | 0

| 수락됨

답변 있음
How to describe function with varying variables?
You can multiply the first equation by a vector that is 1 for t<=L/v and is zero when t>L/v h=(H/2)*(1-cos(2*pi*v*t/L)).*( t<=...

3년 초과 전 | 0

답변 있음
How to save each loop data?
You can make a vector of points as here: c=3e8; %speed of light u=0; uv=[]; yv=[]; while u<(c) y=1/(sqrt(1-((u^2)/...

3년 초과 전 | 1

| 수락됨

답변 있음
How to solve 'vector must be the same length', 'functions behave unexpectedly' errors when graphing vector equation
in the first code, instead of x=3; use this one: x=3*ones(size(t));

3년 초과 전 | 0

| 수락됨

답변 있음
Working with complex numbers in the Symbolic Math Toolbox. Why does angle(A) returns atan2(sin(alpha),cos(alpha)) instead of just alpha?
if you want to find the numerical value of alpha, one solution is to use double function: double(angle(A))

3년 초과 전 | 0

답변 있음
Can I save a MATLAB variable generated by a function into another MATLAB function?
You can use global variables by this line of code in all functions that share the same variables: global var1 var2 var3

3년 초과 전 | 0

답변 있음
Factorial without the Command
Using only basic operations: function f = Factorial(n) % % initial value, 0! and 1! f = 1; if n > 1 for i=2:n ...

3년 초과 전 | 0

답변 있음
Factorial without the Command
function f = Factorial(n) % % if n = 0 || n = 1 f = 1; elseif n >= 1 f = n * Factorial(n-1); end

3년 초과 전 | 0

답변 있음
Loop for creating Submatrix
It should not be two nested loops. You can use one loop that increases a counter. You can use this code that doesn't need a loo...

3년 초과 전 | 0

| 수락됨

답변 있음
How to enter a function into matlab
H/2*sigma.*cosh(k.*(h+z))./sinh(k.*h).*cos(k.*x-sigma.*t) H/2*sigma.^2.*cosh(k.*(h+z))./sinh(k.*h).*sin(k.*x-sigma.*t)

3년 초과 전 | 0

| 수락됨

답변 있음
Index in position 1 exceeds array bounds (must not exceed 2 )
try this for i = j:size(A,1)

3년 초과 전 | 0

더 보기