Réponse apportée
how to use a simple statement to describe a repeat format output about the function "fprintf"?
fprintf(fid,repmat('%4.2f',1,5),data)

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Best way to share code within laboratory
We all use a shared network drive that is added to the path on everyone's MATLAB. Every function in the shared drive has a comm...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Two y axes in subplot
You can use SUBPLOT to set the location for your PLOTYY call. % Data to plot. x = 0:0.01:20; y1 = 200*exp(-0.05*x)....

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
How to plot the columns (second till 15) data against the firs column (simulation time) instead of plotting against the serial number in once by pressing the plot button?
Let's say your data looks like this: D = (0:.01:1).'; % Used to make the data array... D = [D bsxfun(@power,D,1:10)]; ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How to split a nxn matrix into n vectors
Jan is correct. Doing this is a bad idea. If you need to use the POLYDER function on each row of a large array, there are seve...

plus de 13 ans il y a | 0

Réponse apportée
how to find out the correct coefficients from a roots -vector
anonym, you need to think about what you are doing. When you have: a = [2 4 6 8]; this represents this polynomial: 2...

plus de 13 ans il y a | 0

Réponse apportée
Floating point accurarcy and COLON
This explains how the colon operator works. It is an interesting read. <http://www.mathworks.com/support/solutions/en/data...

plus de 13 ans il y a | 5

| A accepté

Réponse apportée
input for function drawgraph(coords)
Are you talking about the function on this page? <http://www.mathworks.com/help/dotnetbuilder/ug/c-integration-examples.html#...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How to break a while loop in a gui toggle button callback?
Here is an example. Basically you have to flush the event queue by calling DRAWNOW or PAUSE to check if the state of the button...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
reshape function row wise
Since you don't give a small example of input and expected output (always a bad practice when asking for help!!), I will guess t...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
"Subscripted assignment dimension mismatch"
This error occurs, much like the message tells you, when you try to put the wrong number (or shape) of items into an array. Her...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
HISTEQ default not consistent with syntax?
IM = imread('cameraman.tif'); I = histeq(IM); I2 = histeq(IM,ones(1,64)*(numel(IM)/64)); isequal(I,I2) ans = ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
change output filename in a loop
<http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F>

plus de 13 ans il y a | 0

Réponse apportée
Need an IF boolean that compares a number to all numbers in an array
a = [1,2,3]; b = 2; if any(b==a) disp('b in a') else disp('b not in a') end Also, see the help for ...

plus de 13 ans il y a | 0

Réponse apportée
search for string array index
That example fails... But let's try this one: x=['a b c0 d';'a b e1 f';'a x d2 f';'m b e1 f';'a b e1 f']; find(x(:,...

plus de 13 ans il y a | 0

Réponse apportée
Prevent rounding of a number.
Why do you think MATLAB is rounding 0.99998474121093744448884876 to 1? F = 0.99998474121093744448884876; F==1 % No ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Read text file containing string and numeric data
fid = fopen('Test.txt'); C = textscan(fid,repmat('%s',1,19),'Headerlines',1) fclose(fid) HeadDiam = str2double(C{8});...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Given matrices XX and YY of sizes 3X3, how can I generate the following matrix: [XX(1,1) YY(1,1); XX(1,2) YY(1,2)... ?
For example: XX = magic(3); YY = cumsum(ones(3)); % Your requested matrix. ZZ = [reshape(XX.',[],1) reshape(YY.',[...

plus de 13 ans il y a | 0

Réponse apportée
axes problem in a plot
You can set the axes limits to be a certain percent of the data or fixed values, depending on what you want. x = -pi:.00...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
how to creat Multiplication table
I am not quite sure if this is what you want, but have a look at this: A = 1:5;, B = 1:10; C = bsxfun(@times,A,B.'...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
hii.. Is it possible to get the coordinates of all the points in a line drawn through plot function in an image?
Aren't there an infinite number of coordinates? Just look at the equation for a line: y = m*x + b; So if you have a s...

plus de 13 ans il y a | 0

Réponse apportée
Save data before error
I recommend you either wrap all of your code in a TRY-CATCH or use DBSTOP so that you don't lose your data again. Note that if ...

plus de 13 ans il y a | 0

Réponse apportée
Finding the numbers of a vector with the same length?
Here's another solution: D = diff(find([1 ~x 1]))-1; D = histc(D,1:max(D))

plus de 13 ans il y a | 2

Réponse apportée
Plotting Points from Cells
Say your cell array is called C, like this: C = cellfun(@(x) rand(1,3),cell(1000,1),'Un',0); Now we can plot the points ...

plus de 13 ans il y a | 2

Réponse apportée
Reboot a gui in Matlab
Here is a simple example: function [] = restart_gui() S.f = figure('menubar','none',... 'numbe...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
How can I generate a matrix with the same vector in all the lines?
I think this is what REPMAT probably is doing behind the scenes: V = 1:3; M = V(ones(1,4),:)

plus de 13 ans il y a | 0

Réponse apportée
Composing arrayfun syntax to extract data from structure
O.k., if you are just messing around with ARRAYFUN. C(1,1).idx = [1;1;2;3]; C(2,1).idx = [1;1;2]; C(1,1).s = {'a';'...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
3D Matrix to replace a square matrix in a for loop?
(To find your MATLAB version, type: ver) Have you looked at BSXFUN? For better suggestions, give some data and a loop that ...

plus de 13 ans il y a | 0

Réponse apportée
Angles from XY coordinates from a matrix
Seems like a simple FOR loop would do the trick. for ii = size(a,1):-1:1 P12 = [a(ii,3)-a(ii,1), a(ii,4)-a(ii,2)];...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
Logical -1 = Logical 1?
Yes: logical([-1 0 1 20 -10 .001 eps ]) The exception is NaN. NaN is non-zero, yet cannot be converted to logical. ...

plus de 13 ans il y a | 0

| A accepté

Charger plus