Risposto
matlab digit precision is not correct?
That is just a display artifact. The entire number is still there in memory. Do this to change the display format format longg ...

quasi 6 anni fa | 0

Risposto
Multiplication with in a double arrray
M = your 4096x2 double matrix M(:,3) = M(:,1) .* M(:,2);

quasi 6 anni fa | 1

| accettato

Risposto
matlabs polyfit not working correctly problem
Highest order is first in the p vector. So explicitly this would be pol = p(1)*T_vec.^3 + p(2)*T_vec.^2 + p(3)*T_Vec + p(4) Yo...

quasi 6 anni fa | 0

| accettato

Risposto
error in using cellfun
This is a limitation of the struct( ) function when fed a cell array. If you examine s you will see it is not what you wanted. ...

quasi 6 anni fa | 0

| accettato

Risposto
arrange an array(1xn) to (rxc)
Not sure how you want the output ordered. Maybe this A = reshape(m,9,9); or this A = reshape(m,9,9).';

quasi 6 anni fa | 0

| accettato

Risposto
while loop ends before the question is answered?
Your break is in the wrong place. It should be under one of the if conditions: if user_number==r disp('Nice job you gue...

quasi 6 anni fa | 1

| accettato

Risposto
Extra independent component in ode integration affects other components
The integrators do not internally step each element separately. They still step the entire state vector as a whole. So even tho...

quasi 6 anni fa | 0

| accettato

Risposto
ODE 45 not working - not enough input arguments
ode45( ) requires that the derivative function handle have the specific arguments (t,y), where y is a single state vector. But y...

quasi 6 anni fa | 0

| accettato

Risposto
ode45 - nonscalar
I suppose you could do something like this instead: F{1} = etc. F{2} = etc. F = F'; f = @(X,T)cell2mat(cellfun(@(c)c(X,T),F,...

quasi 6 anni fa | 0

Risposto
Column Vector - Nonscalar arrays.
F = @(X, T) [F1(X, T); F2(X, T)];

quasi 6 anni fa | 1

Risposto
How to find an explicit function when using Runge-Kutta or one of the pertinent codes in Matlab (ode45)
Symbolic Toolbox doc dsolve https://www.mathworks.com/help/symbolic/dsolve.html

quasi 6 anni fa | 0

Risposto
Extracting parts of matrix for sub matrices
E.g., to put them into a cell array mat = your matrix result = mat2cell(mat,repmat(16,8,1),repmat(16,8,1));

quasi 6 anni fa | 0

Risposto
Exact probability of a triangular distribution
The exact probability of getting a number greater than the mean is simply the sum of the probabily to the right of the mean. Si...

quasi 6 anni fa | 1

| accettato

Risposto
I want to rotate a point using Quaternion function
I took a look at this related link: https://github.com/petercorke/robotics-toolbox-matlab/blob/master/Octave/%40Quaternion/Quat...

quasi 6 anni fa | 1

| accettato

Risposto
Converting sensor frames using Aerospace Toolbox
This discussion on MATLAB quaternion convention might help you: https://www.mathworks.com/matlabcentral/answers/465053-rotation...

quasi 6 anni fa | 0

Risposto
Problems with sortrows and str2double, why is it still string?
>> [~,x] = sort(str2double(Respiration_Values)); >> B = Respiration_Labelled(x,:) B = 7×2 string array "139299" "...

quasi 6 anni fa | 2

| accettato

Risposto
Binary Image: Count number of pixels that are 1.
nnz(bw)

quasi 6 anni fa | 2

Risposto
error when running a function
Do not push the green triangle "go" button in the editor since that calls the function without any input arguments. Instead, cal...

quasi 6 anni fa | 1

Risposto
solving a set of differential equations with ode45
Initial conditions is a 4-element vector: IC1=[0; 0; 298; 298]; But in your derivative function you have this: M=[5,15,25,55]...

quasi 6 anni fa | 0

| accettato

Risposto
Loops - physics - nonlinear gravity & acceleration
Your immediate problem is that h is a vector, so the right hand side of this statement is a vector: g(i+1)=(400000000/(6371+h...

quasi 6 anni fa | 0

Risposto
Looping over column and returning values where conditions are met
In general, perform find( ) on the condition you want. E.g., find(matrix(:,4)>80) would return the row numbers where the 4th c...

quasi 6 anni fa | 0

Risposto
sparse half-precision matrices
The sparse format in MATLAB only supports double and logical data types. To use any other data type you would have to write all...

quasi 6 anni fa | 0

| accettato

Risposto
RK4/AB4, need help with correct code for 2 second order equations in Matlab
So, first define a 4-element state vector. To keep the nomenclature the same as the MATLAB docs, I will use the variable name y....

quasi 6 anni fa | 1

| accettato

Risposto
Cell Arrays and Indexing?
This is the reverse of your last assignment. It needs only one loop over the number of rows, and the cell array element for tha...

quasi 6 anni fa | 0

| accettato

Risposto
Cell arrays and Indexing with Cells HELP?
This row = Q(1:end); col = Q{1:end}; Z(row, col) = true; is actually a good attempt and shows you understand the problem .....

quasi 6 anni fa | 0

| accettato

Risposto
repeat the iteration with an error using try/catch
Maybe this construct does what you want while( true ) try MyProgramHere ...

quasi 6 anni fa | 0

| accettato

Risposto
Storing doubles in the smallest integer class for which they fit without changing their value?
Some hints: Don't use loops, use vectorized code to figure out which integer size works. intmax(type) gives you the largest va...

quasi 6 anni fa | 0

| accettato

Risposto
How do I make a function work with vectors?
Use element-wise divide operator ./ (with the dot) instead of the matrix divide operator / (without the dot). E.g., tanH(x)=((...

quasi 6 anni fa | 0

| accettato

Risposto
ODE solving using RK4 method (Predator prey)
Your basic problem is that you have two states, x and y, but your function arguments are inconsistent with this. Take this code:...

quasi 6 anni fa | 1

| accettato

Risposto
Really! fprintf cell error
What happens if you change this fprintf(fid, '%d %s %s %f',shape{i,:}); to this fprintf(fid, '%d %s %s %f',shape{i,1},shape{i...

quasi 6 anni fa | 0

| accettato

Carica altro