답변 있음
Rename Matrix in Using String
Suppose you could somehow rename your variable to the name contained in filename. What would you do next? How would you access...

대략 6년 전 | 0

답변 있음
Scalar max of cell array with structure
If you reshape the input first, a one-liner version of your code: peak = max(cellfun(@(x) max(abs(x.noise(:))),myCell(:))); ...

대략 6년 전 | 0

| 수락됨

답변 있음
Sum of sequence with accuracy
exp(-x) will calculate that sum.

대략 6년 전 | 1

답변 있음
Need help solving this problem with newtons method
To match how you are calling it, you need to switch the order of the arguments in this function handle: F = @(p, t) k*p*(L-p)-a...

대략 6년 전 | 0

답변 있음
Operators "concatenation" ?
No. MATLAB syntax does not allow using ( ) or { } right after a function call. You could of course create a third function to d...

대략 6년 전 | 0

| 수락됨

답변 있음
Time of sparse matrix components allocation
Every time you add even one element to a sparse matrix, it has to copy data ... perhaps all of the current data ... to make room...

대략 6년 전 | 0

답변 있음
How to get matrix data from function ,anyone help me
Not sure what the real question is. Maybe this does what you want? function [apZ,atZ]=example(a,Z) apZ = a + Z;...

대략 6년 전 | 0

| 수락됨

답변 있음
Order a string row based on another string row by matching each element (like the sort function does)
One way: [~,idxb] = sort(B1); [~,idxa] = sort(idxb); A1new = A1(idxa); A2new = A2(idxa);

대략 6년 전 | 0

답변 있음
How to get multiple roots of x
How are you solving it now? Maybe you just need to feed your method different starting guesses.

대략 6년 전 | 0

답변 있음
Future Bank Account Balance
This line overwrites your old balance vector with a scalar oldbalance = newbalance(i); Instead of keeping track of old balance...

대략 6년 전 | 0

| 수락됨

답변 있음
How to compare elements with above and below element in a column?
Is this what you want? for T = 2:M if( abs(A(T,4) - A(T-1,4)) > 50 ) A(T,4) = 0; end end

대략 6년 전 | 0

| 수락됨

답변 있음
How do I single out elements in a vector?
Hints: You might look at the mod( ) or rem( ) function to determine if values are even. To determine how many are even, you cou...

대략 6년 전 | 0

답변 있음
Matlab crashes while running MEX Fortran 90 routine
Three comments: 1) You should NEVER, NEVER, NEVER pass literal integers into mex API functions. It can often be the case that ...

대략 6년 전 | 0

| 수락됨

답변 있음
Troubles with data types: integers, doubles, scientific notation, and type casting
You are confusing integer "types" with integer "values". Integer types are int8, uint8, ... int16, uint64. Integer values a 1,...

대략 6년 전 | 0

답변 있음
Error using * Inner matrix dimensions must agree.
Use element-wise operators (with the dot .) instead of matrix operators (without the dot .), e.g., x1= 1 - (exp(-(t/4))).*(cos(...

대략 6년 전 | 0

| 수락됨

답변 있음
Cant Use Reshape Function with Randi or Randperm
I'm guessing you need to tell this dec2bin call that it always needs to produce 16 digits also: permboxin_temp = dec2bin(permbo...

대략 6년 전 | 0

답변 있음
Using for loop to match generated random numbers to an input value
Since you don't know ahead of time how many tries it will take, this is best done with a while loop instead of a for loop. E.g.,...

대략 6년 전 | 0

| 수락됨

답변 있음
How can I append a new cell onto the end of a Cell Array?
If F really is a cell array in the format you list, then just C(end+1) = F; If not, then you may have to do this: C(end+1) = ...

대략 6년 전 | 0

| 수락됨

답변 있음
Nonscalar arrays of function handles are not allowed; use cell arrays instead.
You don't need to create an array of function handles. You just need to construct one function handle to use for that iteration....

대략 6년 전 | 0

| 수락됨

답변 있음
Forward Euler method for Higher order differential equation
You need to think of Y as your three element column vector as you have defined. So at each step you are dealing with a column v...

대략 6년 전 | 1

| 수락됨

답변 있음
Subscript indices must either be real positive integers or logicals while k starts from 1 .
The RK4( ) function expects to call the derivative function with the signature F(tt,y), i.e. time is the 1st argument. But your...

대략 6년 전 | 1

답변 있음
My matrix should be symmetric but isn't by a ridiculous margin
Welcome to the world of floating point arithmetic. This is typical and not unusual behavior. https://www.mathworks.com/matlabc...

대략 6년 전 | 0

| 수락됨

답변 있음
Plot a 100x100 grid of 1's and 0's
Another option: b = your binary matrix spy(b);

대략 6년 전 | 0

답변 있음
“Dimensions of arrays being concatenated are not consistent”
TYpe this at the command line: dbstop if error then run your code. When the error occurs the code will pause with all current ...

대략 6년 전 | 0

답변 있음
ODE45 randomly returns vector of length 1.
Try clearing your variables before you run the script. It could be that you are inadvertently using a variable from a previous i...

대략 6년 전 | 0

답변 있음
Solving System of 1st Order ODEs with Euler's method
The easiest way is to treat your y as 2-element column vectors instead of scalars. E.g., % function file function [x, y] = od...

대략 6년 전 | 1

| 수락됨

답변 있음
Cell Array, Example From Manual
The variable C is only a 2D variable having two dimensions. You have requested indexing into a third dimension with that last...

대략 6년 전 | 0

| 수락됨

답변 있음
sum every n columns, element by element
m = your matrix n = number of columns to sum squeeze(sum(reshape(m,size(m,1),n,[]),2))

대략 6년 전 | 1

| 수락됨

답변 있음
How do I get rid of a dimension of length 0 in a multi-dimensional array?
A variable that has a 0 dimension is an empty variable ... there is no data in it to reshape. You need to backtrack in your cod...

대략 6년 전 | 0

| 수락됨

답변 있음
ode euler - explicit method
Add this after each figure statement hold on

대략 6년 전 | 0

| 수락됨

더 보기