Question


What you get with: (0:n-1)*n + 1:n
What you get with: n = 4; (0:n-1)*n + 1:n % 1 2 3 4 I was expecting: (0:n-1)*n + (1:n) % 1 6 11 16

plus de 15 ans il y a | 4 réponses | 2

4

réponses

Réponse apportée
Speed improvement of the random generator
Even generating all the random numbers at once (moving it outside of the loops the gain is small), but the difference lies in th...

plus de 15 ans il y a | 1

Réponse apportée
loops
A = [0 0 0 0 1 0 1 0 1 9 0 0 -1 0 -1 4 0 0]; A(3:5,2) = ...

plus de 15 ans il y a | 0

Réponse apportée
How to extract multi-format data from file?
Walter meant: fid = fopen('C:\Users\Oleg\Desktop\test.txt'); data = fscanf(fid,'%c,%f,%x,%x,%x;%c,%f,%x,%x,%x;%c,%f,%x,...

plus de 15 ans il y a | 0

Réponse apportée
if... then... else?
Try this solution: A = [97 100 93 89 86 80 93 94 95 92 80]; % Preallocate Out = ones(size(A)); % First elem...

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
histogram
[counts,x] = imhist(BW,100)

plus de 15 ans il y a | 0

Réponse apportée
Got error export data from workspace into database
The correct expression for an INSERT is: INSERT table_name VALUES (value1, value2, ...) or INSERT table_na...

plus de 15 ans il y a | 0

Réponse apportée
zero value in beronoulli trials !!!
Some other parenthesis mistakes corrected: N=10; P=0.5; K=0:N; M =exp(P.^K.*(1-P).^(N-K).*factorial(N)./(factorial...

plus de 15 ans il y a | 1

Réponse apportée
gaussian beam height plot
Can you be more specific? What do you want to do with the graph? Also, pdf map the domain into the [0 1] interval. You can't ...

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
neighbour pixel operation
Why did you group in cells in thr first place? Referencing the content of a cell should be done with curly brackets: r{1...

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
Plotting data on same axis as graph created by matlab function
Look at the solution I gave at *<http://www.mathworks.com/matlabcentral/answers/1177-plotting-a-normal-graph-with-a-candlestick-...

plus de 15 ans il y a | 0

Réponse apportée
how can two matlab user write/read single excel sheet via internet from differnt ends
Try to give a look at <http://www.mathworks.com/help/techdoc/ref/ftpclass.html ftp>

plus de 15 ans il y a | 0

Réponse apportée
Increase lengthof variable in a for loop by a certain increment.
Don't use length as a variable: length(start)= length(start)*0.5; You're creating _length_ as a variable which obfuscate...

plus de 15 ans il y a | 1

Réponse apportée
Plot question: Monthly data on yearly axis
You were using datenum incorrectly: startdate = datenum('31-01-2002','dd-mm-yyyy') enddate = datenum('31-12-2010','dd-mm...

plus de 15 ans il y a | 1

Réponse apportée
Truncating fractions
Matt's solution is working. Your question isn't specific enough. You want to display, and not to truncate. A=[0.0001 -0.0...

plus de 15 ans il y a | 0

Réponse apportée
.xml read
<http://www.mathworks.com/help/techdoc/ref/xmlread.html xmlread>

plus de 15 ans il y a | 0

Réponse apportée
Matlab letter "h" question
The letter "h" is there because you cannot name a matlab variable with just digits.

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
Using variables to name excel worksheets.
If _x_ is a number then you have to convert it into a string first: x = 10; xlswrite('excelfile.xls', 10, ['Delta =' spr...

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
Loading multiple datafile of different sizes
Store them in a cell array or in a structure, if you can't concatenate. for I = 0:29 filename = sprintf('Tension&CBResi...

plus de 15 ans il y a | 0

Réponse apportée
Index multiple elements in a vector using logical indexing
For comparison with multiple elements: D = C(ismember(A,B)) Also, avoid to use find when you don't need the coordinates.

plus de 15 ans il y a | 4

Réponse apportée
Determining number heartbeats the data.
If you have signal processing use <http://www.mathworks.com/help/toolbox/signal/findpeaks.html findpeaks>, or download one of th...

plus de 15 ans il y a | 1

Réponse apportée
making answer into array
Are you trying to do: a = [2 1 3 1 1 4 1 5 6 7 1 1 8 1 9 1]; sort(a,2) ans = ...

plus de 15 ans il y a | 0

| A accepté

Réponse apportée
GENERATE MATRIX FROM VECTORS
x = 0:4:8; y = 0:5:15; numX = numel(x); numY = numel(y); y = repmat(y(:),numX,1); x = repmat(x ,numY,1); ...

plus de 15 ans il y a | 1

| A accepté

Réponse apportée
Generation of a column with constants values that increases for different RANGE of row
1) A( 1:30,1) = 10; 2) A(31:60,1) = 18:8:10+8*30; 3) not clear

plus de 15 ans il y a | 1

| A accepté

Réponse apportée
Plotting the variance. Please help fix my code
You can use this approach: % Supose you have an array of 73500 elements and you want to calculate the % variance on non...

plus de 15 ans il y a | 0

Réponse apportée
How to bring Quartly format time excel data to matlab
This is a duplicate post. Please refer to the answer I've given you here: <http://www.mathworks.com/matlabcentral/answers/3646...

plus de 15 ans il y a | 0

Réponse apportée
Converting to quarterly time from xls
You can import xls data with *<http://www.mathworks.com/help/techdoc/ref/xlsread.html xlsread>*: [data, text] = xlsread(filen...

plus de 15 ans il y a | 1

| A accepté

Réponse apportée
Fonts with latex interpreter and no interpreter look different
Des using Tex (default) help? title('2 1.8 1.6 Title with latex character \pi')

plus de 15 ans il y a | 0

Réponse apportée
how to read a data file with textscan when the the data type is inconsistant
Couldn't find a way, then 2 solutions: 1) substitute in you file .#QNAN with empty '' and import afterwards, *<http://www.mat...

plus de 15 ans il y a | 0

Réponse apportée
MCMC
Hi, you don't any loop there: x = s(:,2); y = s(:,3); q = 1000; a = 9.9840; b = 9.9939; c = a + (b-a) * rand(...

plus de 15 ans il y a | 1

| A accepté

Charger plus