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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

Respondida
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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 2

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

más de 10 años hace | 2

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

Cargar más