回答済み
Hex 01A9 to 16-binary?
E.g., if H is not too big: H = '01A9'; B = dec2bin(hex2dec(H),numel(H)*4) Otherwise you will need some form of a loop (explic...

約5年 前 | 0

回答済み
Why getting this error??
Don't shadow the MATLAB min() and max() functions with variables of the same name. Also min() and max() operate on columns by d...

約5年 前 | 1

回答済み
Help me with this task using (Euler`s method)
The function handle is something you only need to create once, before the for-loop starts. Then call that function handle with ...

約5年 前 | 1

| 採用済み

回答済み
Cell Arrays and loops
A cell array uses the curly braces. E.g., MyNames = {'ThisName','ThatName','OtherName'}; The number of elements is simply nume...

約5年 前 | 0

| 採用済み

回答済み
How to write a function handle in vectorized form and avoid an error due to lengthy equation
Your post is inconsistent since it appears to need an even number of columns but you end your example with column 100001, an odd...

約5年 前 | 0

| 採用済み

回答済み
Why does NO ODE function work??
Did you download the code for ode1 from the link provided? https://www.mathworks.com/matlabcentral/fileexchange/54611-solving-o...

約5年 前 | 0

回答済み
Help with creating a for loop
You could take this approach: A = your matrix AA = A*A'; % all of the dot products between rows (more than you need, actually)...

約5年 前 | 0

回答済み
Inexplicable different execution speeds when filling a matrix with complex entries
When an array switches from real to complex in R2018a or later, a new memory allocation and deep data copy must occur to change ...

約5年 前 | 0

回答済み
Error in fzero for solving numerical inverse function
These lines don't do what you think they do syms x g = 1.02*x + 0.6*exp(-8.7*x)-0.292 gx = @(x) g The x in g is symbolic. T...

約5年 前 | 1

回答済み
Code not coming out of if statement.
Sorry for the late reply ... I just saw this post. These lines f1 = @(y) g - sign(y).*cd/m.*y.^2; f2 = @(y) g - sign(y).*(cd...

約5年 前 | 0

回答済み
Runge kutta 4th order
You are using k(j) in your derivative function handles. This is a mistake since it causes the function handles to use the curre...

約5年 前 | 0

| 採用済み

回答済み
How to move elements of vector
Could use a loop on the rows with logical indexing. E.g., vec = whatever z = (vec == 0); for r=1:size(vec,1) vec(r,:) = ...

約5年 前 | 1

| 採用済み

回答済み
Creating vector and matrix from vector
Element-wise multiplication is done with the .* operator (with the dot). E.g., data = Xtrain .* Ytrain; The operation data(:) ...

約5年 前 | 0

| 採用済み

回答済み
How to fill a 3D zeros matrix array
One way: c = arrayfun(@(a)[cos(a), sin(a), 0; -sin(a), cos(a), 0; 0, 0, 1],Tho_t,'Uni',false); result = cat(3,c{:}); Your for...

約5年 前 | 0

| 採用済み

回答済み
plotting one variable function
Your question is unclear. Is it Ri that varies from 2 to 25? And the y-axis and x-axis formulae you have are the coordinates o...

約5年 前 | 1

回答済み
Trying to make a piecewise function that isn't for graphing or using the piecewise function itself
Use logical indexing on both sides of the assignment. E.g., function y = project2Tester(x) y = zeros(size(x)); x1 =...

約5年 前 | 0

| 採用済み

回答済み
Reshape an Matlab array
A straightforward assignment: A = zeros(7,24); A(:,1:2:end) = reshape(RELOADING_PATTERN(:,1),7,12); A(:,2:2:end) = reshape(RE...

約5年 前 | 0

| 採用済み

回答済み
Why won't my while loop terminate?
The forceErr you are calculating happens for every iteration of the for-loop. The forceErr that the while-loop sees is only for...

約5年 前 | 0

回答済み
Issue with Mexfile in parfor loops
Regarding the inplace modification in MATLAB, here is the actual situation: MATLAB uses a system behind the scenes that is ofte...

約5年 前 | 0

回答済み
Dice with changed probabilites
0.8% is the probability of getting three 3's in a throw of three dice. It is not the probability of the number of three 3's in ...

約5年 前 | 1

| 採用済み

回答済み
Restructuring a Vertex into a specific Matrix pattern
See this function: https://www.mathworks.com/help/matlab/ref/sub2ind.html?searchHighlight=sub2ind&s_tid=srchtitle

約5年 前 | 0

| 採用済み

回答済み
How to deallocate the global memory allocated in the mex function if the program has to be terminated outside of the mex function.
As I understand your question, the general approach would be as follows: Have pointers to your allocated memory be "global", i....

約5年 前 | 1

| 採用済み

回答済み
How to create N+1 dimensional array by taking exterior product of 1st dimension of two N dimensional arrays?
Maybe try this: sizeB = size(B); reshapeA = reshape(A,[1 size(A)]); reshapeB = reshape(B,[sizeB(1) 1 sizeB(2:end)]); C = res...

約5年 前 | 0

回答済み
Determining if the columns of a matrix are orthogonal
Using the dot product and comparing it to 0 is a mathematical concept that does not translate well to floating point arithmetic....

約5年 前 | 0

回答済み
No Description of Error for ode45
Looks like your odefun needs additional inputs that you are not providing. E.g., try changing this [t,x]=ode45(odefun,time_int...

約5年 前 | 1

| 採用済み

回答済み
Make Ode45 return non trivial solution
If F(i)=0 and y0=0 and dy0=0, then there is no driving acceleration away from the y(t)=0 solution. I.e., y(t)=0 is the solution...

約5年 前 | 0

| 採用済み

回答済み
How do I make an if statement based on whether an index is part of a vector of numbers?
You can use the ismember( ) function for this. E.g., if ~ismember(currentcycle,abnormal_attractors) previous_expmean_v = c...

約5年 前 | 0

| 採用済み

回答済み
multiply matrices with different dimensions with loop
Is this what you want? C = A .* B.';

約5年 前 | 2

回答済み
Madgwick filter - Quaternion Multiplication
I guess you could generate the following three expressions symbolically: original original + 1 - () original + () - 1 and th...

5年以上 前 | 1

| 採用済み

さらに読み込む