답변 있음
Monte Carlo Simulation - pair of dice roll
You are supposed to count the number of rolls it takes to get boxcars, not the number of boxcars you get in N rolls. So for eac...

대략 6년 전 | 0

| 수락됨

답변 있음
How to concatenate two time arrays with the same time step?
Ttotal = [t1,t1(end)+1+t2];

대략 6년 전 | 1

| 수락됨

답변 있음
plot graph using Tsiolkovsky’s rocket equations.
This Speed(1) = ... needs to be this Speed(i) = ... and this ... v_e*m(i)/m(i-1) ... should be this ... Time_step*v_e*dmd...

대략 6년 전 | 0

| 수락됨

답변 있음
How to solve coupled differential equations with more than one dependent variable and only one independent variable?
This dy(3)= -3*y(1)*y(3)+2*y(2)^2+y(4); should be this dy(3)= -3*y(1)*y(3)+2*y(2)^2-y(4); % changed +y(4) to -y(4) Also, if ...

대략 6년 전 | 0

| 수락됨

답변 있음
About mex function problem
This code is incorrect: int nVars,nSteps,lhs_dims[2]; : plhs[0] = mxCreateNumericArray(2,lhs_dims,mxDOUBLE_CLASS,...

대략 6년 전 | 0

답변 있음
How to graph a complex system of ODEs?
You have three 1st order equations, so you need a 3-element state vector for this. To keep the same nomenclature as the MATLAB ...

대략 6년 전 | 0

질문


Why is the new "half" data type an opaque class?
The good news: The new half precision data type was introduced in R2019b. Graphics cards have been using this for quite some t...

대략 6년 전 | 답변 수: 1 | 6

1

답변

답변 있음
How to convert half-precision number into hexadecimal representation?
I don't have R2019b installed so I don't know how half precision numbers are stored, but can you use typecast: h = your half pr...

대략 6년 전 | 3

| 수락됨

답변 있음
Issue with the cross product of my r and v vectors.
You need to make your r and v matrices of 3-element column vectors, not one long string of number all in a row. That means putt...

대략 6년 전 | 0

| 수락됨

답변 있음
Deleting Row and Column
Q = P(1:end-2,1:end-2);

대략 6년 전 | 0

답변 있음
Custom Euler's Method for Second Order ODE
Your derivative matrix is wrong. It should be this (the -5 and -1000 are switched): A = [0,1;-1000,-5];

대략 6년 전 | 1

| 수락됨

답변 있음
I am 2nd year university student and unfortunalty due to corona virus im strugging with Matlab code. Can i email someone on here who has time to help me with a few questions on a car crash study.
This is essentially a pendulum problem with two forces acting on it instead of just one, gravity acting vertically down and cras...

대략 6년 전 | 0

답변 있음
Override subsasgn of MATLABs double?
Overriding subasgn for a native class like double is a very bad idea, because it affects everything, not just the code that you ...

대략 6년 전 | 2

답변 있음
Need help solivng euler method code
This n = numel(y0); needs to be this instead n = numel(x); % number of independent variable values Then you need to initiali...

대략 6년 전 | 0

답변 있음
How to plot simple function
Error message says to check for mismatched delimiters. So this y=(1/(1+(25*x^2)); should be this with one fewer paren: y=1./(...

대략 6년 전 | 0

답변 있음
A function calculating the value of expression (sin(x) - x)*x^(-3).
So, for small values of x your code looks correct to me (although the N=200 is WAY WAY OVERKILL ... you don't need nearly this m...

대략 6년 전 | 0

답변 있음
Index in position 1 is invalid. Array indices must be positive integers or logical values.
What are the values in Fb and Tb? You can do this at the command line: dbstop if error Then run your code. When the error occ...

대략 6년 전 | 1

답변 있음
Most Efficient Way to Construct the Matrices to Extract the Lower and Upper Triangle from a Vectorized Matrix
Here is a mex routine that generates the sparse double matrices mL and mU directly, so no wasted memory in creating them. Seems...

대략 6년 전 | 2

| 수락됨

답변 있음
How do you substitute x(1),x(2),x(3) in place of kp,ki and l respectively?
To keep your equation the same, e.g., y1 = @(kp,ki,l) ((1/10^(l + 1)*ki*kp*l*sin((pi*l)/2))/(kp + (ki*kp*cos((pi*l)/2))/10^l) -...

대략 6년 전 | 0

답변 있음
what is the number in a position in an array?
Indexing: m(2)

대략 6년 전 | 0

| 수락됨

답변 있음
Dont why i keep getting reshape error anytime i run this.
This line reshape = reshape(encrypt,50,50); %50x50 shadows the MATLAB reshape( ) function with your own variable called reshap...

대략 6년 전 | 0

답변 있음
When ever I use disp() Matlab prints out an extremely long fraction, that turns out to be correct
When you see those long fractions it means you have invoked the Symbolic Toolbox. To get that result back to normal doubles, ju...

대략 6년 전 | 0

| 수락됨

답변 있음
mex error: cannot convert ‘int*’ to ‘const mwSize* {aka const long unsigned int*}’
I haven't looked at the code, but the error messages indicate you've got some definitions in your code like this: int dims[what...

대략 6년 전 | 4

답변 있음
Help with my mex function output from cudamemcpy2D
Why is this created as a single class, and then a short pointer is used to access it? *A = mxCreateNumericArray(ndim2, dims_n4...

대략 6년 전 | 0

| 수락됨

답변 있음
Meaning of "theSum = sum(theString - '0')"
This theString - '0' turns both arguments into doubles with the ASCII values and subtracts them. That is, the '0' value gets ...

대략 6년 전 | 1

| 수락됨

답변 있음
Help with how to include a mean value calculator in a for-loop
Does this do what you want? arsol2015 = mean(reshape(sol2015,24,[])); Although not needed, your loop could be this for i = 1:...

대략 6년 전 | 0

| 수락됨

답변 있음
Finding collumn with specific values within matrix
Is this what you are trying to do? indt = ind(1:5,:)'; [~,k] = ismember(sort(v1)',indt,'rows'); index1 = ind(6,k) The first ...

대략 6년 전 | 0

| 수락됨

답변 있음
is matlab variable object?
All variables have a "class". But not all variables are objects from an OOP class defined with classdef. I think what you are ...

대략 6년 전 | 0

| 수락됨

답변 있음
how to find the position of in the matrix without using the neither find nor built in functions.
Just add variables to keep track of the locations. E.g., if M(a,b) < min min = M(a,b); mi...

대략 6년 전 | 0

| 수락됨

더 보기