Beantwortet
how to run the m-file several times
It is not entirely clear to me what you try to achieve. If you want to load s from different mat files, you can do so using ...

fast 11 Jahre vor | 0

Beantwortet
Help on conversion of data
With 4 bits you can code 32 numbers, like the integers from 0 to 31. You cannot convert double precision numbers between 0 and 1...

fast 11 Jahre vor | 0

Beantwortet
How do I get the element of a cell in a case_expression that matches the switch_expression?
You can use a(strcmp(a, b))

fast 11 Jahre vor | 0

Beantwortet
How can I extract the last rows of specific columns of a text file
Read the data from file, ignoring 1 header line: data = cell2mat(textscan(fopen('a.txt'), '%f%f%f', 'headerlines', 1)); ...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Error using fgets Invalid file identifier. Use fopen to generate a valid file identifier.
Add if fid == -1 error('Cannot open file.') end You probably misspelled txtfile or it is not in the current direc...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Rearranging column of m by 1 matrix.
reshape(reshape(D, 2, [])', 1, [])

fast 11 Jahre vor | 0

Beantwortet
How to delete the nth element from all the variables in my workspace?
x = whos; n = 2; for i=1:numel(x) eval([x(i).name '(' int2str(n) ')=[];']) end

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
Inverting and reshaping matrix which includes NaNs
You can rearrange the matrix by reversing the order of the non-NaN elements in each row such that the first column represents th...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
If 'variable' is an indexed variable, performance can be improved using logical indexing instead of FIND
mpc.bus(mpc.bus(:,2)==3, 2) = 1; mpc.bus(mpc.bus(:,1)==mpc.gen(16,1), 2)=3;

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Minimum y-value in each column
[~,idx] = max(X); Note that this returns 1 for columns that are all zero.

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to merge a contour plot with the image it is derived from
I failed to run your code, because >> contour(flipud(image)); Error using flipud (line 19) X must be a 2-D matrix. ...

fast 11 Jahre vor | 0

Beantwortet
Wind rose - how to remove axis?
rose uses polar to plot, so you can remove the lines as you would do for polar <http://www.mathworks.com/matlabcentral/answers/...

fast 11 Jahre vor | 0

Beantwortet
How to find least 8 values in a 1xN row matrix with their positions?
[~, ind] = sort(A); B = ind(1:8)

fast 11 Jahre vor | 0

Beantwortet
how to write in the text file?
FN1 = 'JDA'; mn = 1:12; yr = 9:13; ext = '.ohh'; format = sprintf('%s%%03d%%02d%s\n', FN1, ext); ...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
drawing a line using drawnow
axes axis([x_1-10 x_2+10 y_1-10 y_2+10]) hold on tmax = 5; for t=0:0.01:tmax plot(x_1+(x_2-x_1)*t/tmax, y_1+(...

fast 11 Jahre vor | 0

Beantwortet
Find Diverging point of two arrays
You can compute the difference between both lines and find the point of divergence when the difference exceeds some threshold. ...

fast 11 Jahre vor | 0

Beantwortet
Why I am getting an error like image Indexed CData must be size [MxN], TrueColor CData must be size [MxNx3]
<http://blogs.mathworks.com/steve/2011/09/27/digital-image-processing-using-matlab-reading-image-files/#5> Use 'Index' to add...

fast 11 Jahre vor | 0

Beantwortet
Subscripted assignment dimension mismatch.
The variables G1, G2, G3, G4 are 1x365, so N1(i) + (G1+2*G2+2*G3+G4)*(h/6) is 1x365, and you try to assign this vector to a sing...

fast 11 Jahre vor | 0

Beantwortet
How to create a loop in matlab codes?
theta = 23; % some starting value for i = 1:10 % run 10 times, for example a = exp(i); % sample computations for a, b,...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Please help me to fix Index exceeds matrix dimensions error.
splittedLine{2} seems to have fewer than 2 cells.

fast 11 Jahre vor | 0

Beantwortet
Doubt in fprintf with double bar
\ starts many escape characters, like \n or \r. To print a single \, you have to use the escape character \\. fprintf(fileI...

fast 11 Jahre vor | 2

Beantwortet
How can I get square brackets on a Swiss macbook keyboard?
alt-5 alt-6

fast 11 Jahre vor | 2

| akzeptiert

Beantwortet
Read batch data files
Use dir to get the names of the files and then use a for loop to process the files.

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Histogram-based segmentation error
Use imshow(C, []) Because you scaled B with 255, the m values are within the range [0 255], so your C is in the range [...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Hi,I have numerical matrix 4X4, I have to classify numbers in grades like less than 20, greater than 20 and less than 20, so Hhow can I do it?
X = randi(30, [4 4]) g20 = X(X > 20) le20 = X(X <=20)

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
fill a matrix from vectors
v1 = [1 2 3]; v2 = [3 4 5]; M = [v1; v2]

fast 11 Jahre vor | 0

Beantwortet
problem with opening a 'ftp' link in Matlab
f = ftp('sidads.colorado.edu') data = mget(f, 'pub/DATASETS/nsidc0032_ease_grid_tbs/global/2013');

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Problem with dimension of a vector
For cont == 7, the expression x(j,i) >= front is always false so funVal(cont,j) = exp(-rho*tauStar(1,j))*(pStar(1,j)-c); ...

fast 11 Jahre vor | 0

Beantwortet
How do I use csvwrite in order to give me the data in a column and NOT in a single comma-separated line?
If the data is a column vector, it is printed as such csvwrite('test.txt', (1:5)') >> type test.txt 1 2 3 ...

fast 11 Jahre vor | 0

| akzeptiert

Mehr laden