질문


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

대략 15년 전 | 답변 수: 4 | 2

4

답변

답변 있음
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...

대략 15년 전 | 1

답변 있음
loops
A = [0 0 0 0 1 0 1 0 1 9 0 0 -1 0 -1 4 0 0]; A(3:5,2) = ...

대략 15년 전 | 0

답변 있음
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,...

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 0

| 수락됨

답변 있음
histogram
[counts,x] = imhist(BW,100)

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 1

답변 있음
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 ...

대략 15년 전 | 0

| 수락됨

답변 있음
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...

대략 15년 전 | 0

| 수락됨

답변 있음
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-...

대략 15년 전 | 0

답변 있음
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>

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 1

답변 있음
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...

대략 15년 전 | 1

답변 있음
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...

대략 15년 전 | 0

답변 있음
.xml read
<http://www.mathworks.com/help/techdoc/ref/xmlread.html xmlread>

대략 15년 전 | 0

답변 있음
Matlab letter "h" question
The letter "h" is there because you cannot name a matlab variable with just digits.

대략 15년 전 | 0

| 수락됨

답변 있음
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...

대략 15년 전 | 0

| 수락됨

답변 있음
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...

대략 15년 전 | 0

답변 있음
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.

대략 15년 전 | 4

답변 있음
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...

대략 15년 전 | 1

답변 있음
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 = ...

대략 15년 전 | 0

| 수락됨

답변 있음
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); ...

대략 15년 전 | 1

| 수락됨

답변 있음
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

대략 15년 전 | 1

| 수락됨

답변 있음
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...

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 1

| 수락됨

답변 있음
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')

대략 15년 전 | 0

답변 있음
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...

대략 15년 전 | 0

답변 있음
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(...

대략 15년 전 | 1

| 수락됨

더 보기