已回答
Plotting a spiral in MATLAB knowing the start and end points and number of turns?
This does the job (for an integer number of turns) % given values pos = [8 4 ; % startpoint 2 7 ] ; % endpoint ...

8 years 前 | 5

| 已接受

已回答
why '==' is not working properly, or what do I do wrong?
There is a small difference, as shown by subtraction: b(100)-a(5) To tolerate such a small difference between x and y, try thi...

8 years 前 | 2

已回答
a problem while using an anonymous function
You do not show the whole error message! But I also assume that the problem is indeed in the use of factorial inside the func...

8 years 前 | 0

已回答
Error: Dot indexing is not supported for variables of this type when initializing an array
As described in the comments, this produces the same error: A = {} ; % cell A{1}.x = 1:10 % -> error! % Unable to per...

8 years 前 | 0

已回答
how to extract the string from the struct array
I think you have a so-called struct array. Try: PSM(1).name

8 years 前 | 0

已回答
Why do the decimals disappear when I put the values into an array?
You have somehow initialised the array _value_ as a *uint64*. When you add a row, this new row is hence converted to uint64 as w...

8 years 前 | 0

已回答
I am Having Cell element 1X2, of 8 bit each i want it to make as individual element 1x16???
Your variable d is a *cell array of strings*. Here is a simple trick to concatenate the cells ( _using comma-separated list expa...

8 years 前 | 1

| 已接受

已回答
How to make precision and recall of same length?
You want to do some kind of interpolation, for instance, using: r12_adjusted = 0.1:0.1:1.0 % take care (##) p1_adjusted...

8 years 前 | 0

已回答
Matrix manipulation Specific rows and columns
First you need to read in the excel into a regular matlab array. Then use logical indexing to select your data. An example: ...

8 years 前 | 0

已回答
combining cell arrarys to one cell
I think you want to concatenate the n cells into a simple n-by-4 array, like this C = {[1 2 3 4],[2 3 4 5],[4 3 2 1]} % n=3...

8 years 前 | 1

| 已接受

已回答
How to sort rows of a cell array by date/time when the other columns are different data types?
I assume your date time are stored in strings. Here is a simple approach % some data C = {'A' datestr(now) 1 11 ; 'B' d...

8 years 前 | 0

| 已接受

已回答
Trying to split a Matrix into two matrices dependant on the value of row elements.
You reduce the size of A in the loop! Here is the matlab way to go, split in multiple lines, so you can follow its logic: ...

8 years 前 | 0

| 已接受

已回答
Matrix Manipulations - How to achieve these specific forms?
Bruno's and KSSV's answers do not create the matrices you asked for, or am I mistaken? Anyways, here are my suggestions: ...

8 years 前 | 2

| 已接受

已回答
Hello, I am new to Matlab and want help to count number of rows in a matrix that belong to data subset.
Let A be your matrix, as above. I suggest you study the outcome of each step below: tf1 = isnan(A) tf2 = all(tf1,2) i...

8 years 前 | 0

| 已接受

已回答
sortrows problem, i can't run my code file
This replicates when the input to sortrows is not what you think it is. A = [3 ; 1 ; 2] % 1 column only sortrows(A, 2) ...

8 years 前 | 0

已回答
could anyone help me to find the first number in the row
<</matlabcentral/answers/uploaded_files/128473/Untitled.png>> It took me some time but I've found it for you :-)

8 years 前 | 1

已回答
How to plot a heatmap of a table where the rows represent y position and columns the x position using the data as the heat variable.
Version 2017a introduced the function *heatmap*. See the documentation: <https://uk.mathworks.com/help/matlab/ref/heatmap.htm...

8 years 前 | 0

| 已接受

已回答
reshape matrix without loop
A simple one-liner would do, I think, letting accumarray do all the work: A = [ 1 1 5 1 2 6 ...

8 years 前 | 2

| 已接受

已回答
Is there a way to create such type of "block diagonal' matrix without loop?
A = [ 1 2 3 ; 4 5 6 ] B = arrayfun(@(k) sparse([2 3 3],[1 2 3],A(k,[1 1 2])),1:size(A,1),'un',0) B = cat(1,B{:}...

8 years 前 | 0

已回答
Plotting lines are broken, can anyone help me out how to fix this issue? It is related to Graphics but my graphics drivers are upto date.
Using the double dashes in the plot command does create a broken line. Use a single dash to create a solid line: x = 1:10 ;...

8 years 前 | 1

| 已接受

已回答
how to convert cell array to a matrix?
A = {[1 2 3],[4 5],6 ; [11 12],13,[] ; 21, [22 23], [24 25]} % data B = arrayfun(@(k) cat(2,A{k,:}),1:size(A,1),'un',0) ...

8 years 前 | 0

提问


is there a way to get the values associated with the *minor* tick marks?
_get(gca, 'xticks')_ only returns the major tick marks ... Thanks! ~ Jos

8 years 前 | 1 个回答 | 0

1

个回答

已回答
randomization of a vector by blocks
C = repmat(1:13,1,2) % conditions per block % [block1 block2] rC = [C(randperm(numel(C))) C(randperm(numel(C)))] % *corr...

8 years 前 | 0

| 已接受

已回答
hi, I have 2 columns data, In that every 1 column data of 1000 value (like 1.2345). i have split this data into (1 to 30), (1 to 60),so on (1 to 990).
Here is a way: data = randi(10,20,1) % some data (20 points, rather than 1000, so easy to check) n = 4:4:numel(data) ...

8 years 前 | 0

| 已接受

已回答
NaN/Inf/Complex value warning using "fit"
Your model is ill-suited to this set of data, as you can verify by checking the output of data_fit. When you provide a proper st...

8 years 前 | 0

已回答
NaN and Inf error when using "fit"
Are you really sure? Set a breakpoint in line 47 of your function MyCode, and check the values you enter into *fit* ...

8 years 前 | 0

已回答
Sampling from an image file without replacement
% select 70 random indices without replacement between 1 and numImages imIDX = randperm(numImages, 70) ; for K = imI...

8 years 前 | 0

已回答
create multiple arrays or matrix from function input
Here is an example. I suggest you store the result in a cell array where each cell can hold a vector with a different length ...

8 years 前 | 0

已提交


randomwalk
Create a random walk in any number of dimensions

8 years 前 | 557 次下载 |

0.0 / 5
Thumbnail

已回答
How to create a random walk in 1d array
Let N be the number of steps into the random walk in X dimensions, this is a one-liner that produces the positions: N = 50...

8 years 前 | 1

加载更多