Réponse apportée
Rearranging matrices
I agree with Sean de that indexing into your arrays would be easier if they were stacked in the third dimension. B = permute(...

environ 15 ans il y a | 1

Réponse apportée
Updating application data from several GUI's
Why not just store all needed information in the root? setappdate(0,'cellarray',cellarray); then from anywhere else: cell...

environ 15 ans il y a | 1

| A accepté

Réponse apportée
while loop, user-defined function, to find prime numbers
If the idea is to use a WHILE loop, you should think about what can be checked one at a time. Take N = 9; SN = floor(sqrt(N)...

environ 15 ans il y a | 0

Réponse apportée
need to extract rgb value of image in the format [r g b]
Somehow you don't have the image handle. So try this: IH = findall(0,'type','image'); IM = getimage(IH);

environ 15 ans il y a | 0

| A accepté

Réponse apportée
remove slider from Listbox
As Walter says, this cannot be done in MATLAB. I cannot really think of a reason why you would want to do this, but if you have...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
Simple Problem - Message Box Function
function messageBox h1=msgbox('Message Display','','none','non-modal'); set(h1,'Deletefcn',@closeMsg); ...

environ 15 ans il y a | 1

| A accepté

Réponse apportée
gettting error in this mex file
Did you mex the file? mex pred_lt_3.c You need to mex the file before you can use it.... Also, the beginning { and ending }...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
Assign multi-dimension array to data structure array without for-loop
For example: clear T S T = rand(3,3,3); S(1:3) = struct('a', mat2cell(T,3,3,[1 1 1])); isequal(T(:,:,2),S(2).a) % just ...

environ 15 ans il y a | 0

Réponse apportée
Is it possible to replace ranges of a matrix elements using indices from two vectors?
Modified FOR loop for speed... N = 5; X = false(N); for ii = 1:N X(ii,a(ii):b(ii)) = 1; end X = dou...

environ 15 ans il y a | 2

| A accepté

Réponse apportée
'fname' variable or function?
Yes, fname is a common moniker for a filename string used in MATLAB. Since you give no details, I cannot guess what kind of fil...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
surf cannot be complex
You forgot a couple of dots (g^ -> g.^) in your code. d1 = 0.0002:0.00001:0.0004; g1 = 70:90; [d,g] = meshgrid(d1,g1);...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
3d plot change view / reverse axis
Have you tried the command: rotate3d Put this command after your call to SURF, then click on the plot and spin it around t...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
using mex for C
Is the name of your file saved on disk as COSENO.C (capitalized and all)?

environ 15 ans il y a | 0

Réponse apportée
undefined function or method 'impl' for input arguments of type 'function_handle'.
Since you are the one using impl, whether it is a function or a variable, why not tell us what it is? If it is supposed to be a...

environ 15 ans il y a | 0

Réponse apportée
Is there a way to record a user action into a script
The short answer is yes. You can use the <http://www.mathworks.com/help/techdoc/ref/input.html INPUT> function to get user inpu...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
Sum of Rows
I simply copied and pasted your data into a textfile I named stock_prices.txt, then: % Retrieve the data... fid = fopen('...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
sort function
I think you will have to clarify your question more. What do you mean by "in a row?" Does this mean that they are integers sep...

environ 15 ans il y a | 1

| A accepté

Réponse apportée
save button condition?
You don't mention what it is that you are protecting, a variable or file for example, so I will speak generally. R = get_name...

environ 15 ans il y a | 0

Réponse apportée
Dumb mistakes we make with MATLAB.
Not so much with MATLAB, but with MATLAB answers. This one has bitten me several times. I will edit an answer I had given ea...

environ 15 ans il y a | 2

Réponse apportée
How to use trapz and cumtrapz
x = -2:.01:2; intg = trapz(x,myfun(x)); Jan beat me to it! But CUMTRAPZ is the cumulative integral on your *data*, not a f...

environ 15 ans il y a | 1

| A accepté

Réponse apportée
How does Squeeze work?
In addition to what James said, just look at an example or two. Look what happens to the dimensions of A with squeeze, particul...

environ 15 ans il y a | 6

| A accepté

Réponse apportée
Find Min of Matrix without using MIN or explicit loops (FOR or WHILE)
Here is a way to do it without MATLAB loops. Though I think the idea John has in mind would be better! mn = sort(A); mn =...

environ 15 ans il y a | 0

Réponse apportée
make several matrices in a for loop
for ii=0:9 matrix{ii+1} = rand(12,12); end

environ 15 ans il y a | 3

| A accepté

Réponse apportée
color of marks in polar plot
Walter hit on the only solution that makes sense to me. It is not that bad, for instance: % Sample Data... A = linspace...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
how to add iterations to a matrix as values in a loop and get the inverse of the matrix
There is something you left out. Because this does not error: th2 = 0:1:360; As it is a simple assignment. Post the actual...

environ 15 ans il y a | 1

| A accepté

Réponse apportée
How do I change the marker size for a plot?
To make this type of thing much easier, you could download this code so that all these options are available from a simple mouse...

environ 15 ans il y a | 1

Réponse apportée
plot sinc function
ezplot(@sinc) Or, more generally: x = -5:.01:5; plot(x,sinc(x)) This is if you have the signal processing toolbox. If ...

environ 15 ans il y a | 2

Réponse apportée
Sending parameters to a function
Of course, "But it don't work" is _*very*_ vague. <http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-...

environ 15 ans il y a | 0

| A accepté

Réponse apportée
replacing numbers in columns
Laura's solution will not preserve the order. To preserve the order, do a transpose first. Here is an example: % Sample Dat...

environ 15 ans il y a | 0

Réponse apportée
Label shift when saving to .eps
Try this: <http://www.mathworks.com/matlabcentral/fileexchange/23629 Export_Fig> % % % *EDIT* Try setting the YTickMode ...

environ 15 ans il y a | 0

Charger plus