Pregunta


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

más de 15 años hace | 4 respuestas | 2

4

respuestas

Respondida
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...

más de 15 años hace | 1

Respondida
loops
A = [0 0 0 0 1 0 1 0 1 9 0 0 -1 0 -1 4 0 0]; A(3:5,2) = ...

más de 15 años hace | 0

Respondida
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,...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

| aceptada

Respondida
histogram
[counts,x] = imhist(BW,100)

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 1

Respondida
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 ...

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 0

| aceptada

Respondida
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-...

más de 15 años hace | 0

Respondida
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>

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 0

Respondida
.xml read
<http://www.mathworks.com/help/techdoc/ref/xmlread.html xmlread>

más de 15 años hace | 0

Respondida
Matlab letter "h" question
The letter "h" is there because you cannot name a matlab variable with just digits.

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 0

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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.

más de 15 años hace | 4

Respondida
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...

más de 15 años hace | 1

Respondida
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 = ...

más de 15 años hace | 0

| aceptada

Respondida
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); ...

más de 15 años hace | 1

| aceptada

Respondida
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

más de 15 años hace | 1

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 1

| aceptada

Respondida
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')

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

Respondida
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(...

más de 15 años hace | 1

| aceptada

Cargar más