답변 있음
How to save ode45 outputs in a loop?
Don't use a loop. Just call ode45 once and it will give you the entire results in T and Y. [T,Y] = ode45(dydt, t, [y0, dy0]); ...

6년 초과 전 | 0

답변 있음
Creating vectors by rand() and looping it
Good start, but do this to save the ceil function result back into vector: vector = ceil(vector); For the next part you need a...

6년 초과 전 | 0

| 수락됨

답변 있음
How do I pull a value out of a different equation @ a specific value
[Tmin,k] = min(T); Dt = D(k);

6년 초과 전 | 0

| 수락됨

답변 있음
Multiplying every secound element in a vector with -1
Or yet another of the zillion ways vny = v; vny(2:2:end) = -vny(2:2:end);

6년 초과 전 | 1

답변 있음
Too many output arguments.
Why not just c = 2*x; d = 4*y;

6년 초과 전 | 0

답변 있음
How to call all arrays that start with the name "CV_"?
Don't do that. See this post for reasons why: https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-sh...

6년 초과 전 | 0

답변 있음
Trying to create a simple function Matlab gives me an error message
Put your vecout( ) function code in a separate file called vecout.m

6년 초과 전 | 0

답변 있음
Hi guys, help me, please!
MATLAB indexing is 1-based, not 0-based. You will need to adjust your indexing: a(1) = 1; a(2) = 0; : etc

6년 초과 전 | 0

답변 있음
Dimensions of arrays being concatenated are not consistent.
If they are all row vectors, then I would think something like this: Total_No_cells_r = [Total_No_cells_r, total_cellcount_r]; ...

6년 초과 전 | 0

답변 있음
Extract integer number from a cell array.
You could do this: C = your cell array of strings, some containing numbers d = str2double(C); d = d(~isnan(d));

6년 초과 전 | 0

답변 있음
Why is the inv function not working in this code (simple)
Best to put commas in your matrix difinition so that the parser doesn't inadvertently combine things that you didn't want. E.g.,...

6년 초과 전 | 1

| 수락됨

답변 있음
(ODE45) Unable to perform assignment because the left and right sides have a different number of elements
It might be simpler to have separate files for this. Put this code (and only this code) in a file called HW4_matlab.m %% Solvi...

6년 초과 전 | 0

답변 있음
Precision in calculation of large digits
You need to convert to vpa first so that the factorial calculation is done with extended precision. factorial(vpa(97))

6년 초과 전 | 2

답변 있음
Attempting to completely fill out an array(6,7) with 1's and 2's for connect4
Maybe you could explain what your code is supposed to be doing. Commenting the code would be great. But if you just want a boa...

6년 초과 전 | 0

답변 있음
not enough argument input
You need to put your function code into a file called dew_point.m Then you need to call your function with inputs, e.g. T = so...

6년 초과 전 | 1

답변 있음
Can someone help me Create a function called that will automatically generate an array where the elements in the array are the sum of the indices? i am lost on this.
If I understand your description correctly, the magic( ) function has nothing to do with your assignment. You are simply asked t...

6년 초과 전 | 1

| 수락됨

답변 있음
Data arithmatic addition with single precision
Floating point operations will often yield slightly different results if you change the order of operations. This is to be expec...

6년 초과 전 | 0

답변 있음
How to locate the index of the maximum value in a given range
Use the 2nd output of the max function: [p,i] = max(y); p is the max value, i is the index of the max value t(i) is the value...

6년 초과 전 | 0

| 수락됨

답변 있음
Change all elements in 2nd column to 3
vArr(:,2) = _____; % <-- you fill in the blank

6년 초과 전 | 0

답변 있음
Create array Arr with 5 rows and 4 columns with each element = 5
Yes. Replace all of your numbers with 5 and you will have it. E.g., Arr = [5 5 5 5; etc. This is the hardest way to accomplish...

6년 초과 전 | 0

답변 있음
Create array Arr with 5 rows and 4 columns with each element = 5
Hint: doc zeros doc ones doc repelem doc repmat

6년 초과 전 | 0

답변 있음
if i have 256x256 matrix and i want to zero padding it to 512x512 how can i do ?
If you just want it padded on two sides, then simply k_im = your 256x256 matrix k_im(512,512) = 0; % pad 0's out to (512,512) ...

6년 초과 전 | 0

답변 있음
How can I plot accleration in the x, y, and z directions? Each accerlation coordinate a(x,y,z) is associated with a moment in time.
Would a simple 2D plot suffice? E.g., plot(t,x,t,y,t,z); grid on legend('x','y','z'); xlabel('time') ylabel('acceleration'...

6년 초과 전 | 1

답변 있음
how to write the this in matlab e^((x^-1)/2) -1
y = exp((x.^2-1)/2) - 1; See the Getting Started section of the doc for initial help on writing MATLAB code.

6년 초과 전 | 0

| 수락됨

답변 있음
Save serial datenum as decimal, not scientific notation
First, MATLAB stores all doubles the same way ... as IEEE binary floating point format. What you are seeing as "737389.4167 beco...

6년 초과 전 | 0

답변 있음
Breaking changes for C++ API?
The current online doc for mxCreateStructMatrix( ) says the last argument must contain "... one or more field names ...", which ...

6년 초과 전 | 0

답변 있음
Writing a funciton for e^x values?
You use the same n value for the first three terms. You need to increment n each time you add a term, including the first two t...

6년 초과 전 | 0

답변 있음
Trying to write a function for the inverse of a matrix.
You are missing the part where you append the identity matrix to the right side of A before you start your Gauss elimination. So...

6년 초과 전 | 0

답변 있음
mex fortran code containing intrinsic function using Intel fortran compiler
Can you post the offending code? Maybe you are calling it with a non-real argument and the compiler is complaining that it can't...

6년 초과 전 | 0

답변 있음
How to re-prompt user input if given incorrect value?
str2double will turn your inputs into numeric, so you will pass your isnumeric( ) test even if there are problems. Instead, chec...

6년 초과 전 | 0

| 수락됨

더 보기