Réponse apportée
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 ...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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))

plus de 10 ans il y a | 0

Réponse apportée
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)); ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
Rearranging column of m by 1 matrix.
reshape(reshape(D, 2, [])', 1, [])

plus de 10 ans il y a | 0

Réponse apportée
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

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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;

plus de 10 ans il y a | 0

| A accepté

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

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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. ...

plus de 10 ans il y a | 0

Réponse apportée
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/...

plus de 10 ans il y a | 0

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

plus de 10 ans il y a | 0

Réponse apportée
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); ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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+(...

plus de 10 ans il y a | 0

Réponse apportée
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. ...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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,...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
Please help me to fix Index exceeds matrix dimensions error.
splittedLine{2} seems to have fewer than 2 cells.

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 2

Réponse apportée
How can I get square brackets on a Swiss macbook keyboard?
alt-5 alt-6

plus de 10 ans il y a | 2

| A accepté

Réponse apportée
Read batch data files
Use dir to get the names of the files and then use a for loop to process the files.

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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 [...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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)

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
fill a matrix from vectors
v1 = [1 2 3]; v2 = [3 4 5]; M = [v1; v2]

plus de 10 ans il y a | 0

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

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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); ...

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

Charger plus