Réponse apportée
How should I scratch this ticket?
function [R,cnt] = winning_numbers() % Generates 6 winning numbers on [1 25] and returns a seed to the % twister algori...

presque 15 ans il y a | 2

Réponse apportée
what does {:} mean?
When used alone, it means to display all contents of a cell array. C = {magic(3);'how';rand(1,2);'pizzaz';magic(8)}; C{:}...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Attempting to rearrange a 3x3 "magic" matrix
If it must be done using storage techniques (as you seem to be suggesting), simply work your way down the matrix. M = magic(3...

presque 15 ans il y a | 0

Réponse apportée
help me please
Thanks for showing some work. Here is how one could approach the first task: n = 10000; m = 100; PROB = zeros(1,m); f...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
GUI picture is already loaded in axes when GUI opens
In the gui_OpeningFcn, put: cla reset(gca) % Should undo the zoom.

presque 15 ans il y a | 1

| A accepté

Réponse apportée
plot of a string vector vs numeric vector
y=[1 2 3 4 5 6] x=['a','b','c','d','e','f'] plot(y) set(gca,'xticklabel',x.')

presque 15 ans il y a | 9

| A accepté

Réponse apportée
Matrix/Image Merging
Kyle, what to do when multiple matches are found in B, since your example B has duplicates? % % % % % *EDIT* In response ...

presque 15 ans il y a | 1

Réponse apportée
guidata doesn't work (the way I expected it to)
The handles structure and the stuff stored in GUIDATA are not the same thing. If you want to be able to store new stuff in a st...

presque 15 ans il y a | 0

Réponse apportée
Adding new fields to a dataset array?
tmp.ID(1:5) = {'100'}; % If 5 is the size you want.

presque 15 ans il y a | 0

Réponse apportée
Beginner's roblems with arrays
I cannot see a clear pattern since you are setting timestep(3,T(1,2)+1:T(1,3)) = V(1,2); Now if it was THETA(2), that we co...

presque 15 ans il y a | 0

Réponse apportée
euclidean distance,output
You could make a little function: function y = mydist(x) % Takes a three digit binary string argument. switch x ca...

presque 15 ans il y a | 0

Réponse apportée
reshaping
A = [1 0 1 0 0 0 1]; B = [1 1 1 0 0 0 1]; s = reshape([A;B],1,[])

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Help in solving an integral using MATLAB
f = @(x,y)(1./((3.11e-6)-((2.25e-6).*(((1-((x.^2)./(1e-8))).^2).*((1-((y.^2)./(1e-8))).^2).*(1+((1.1e-8).*(x.^2))+((1.1e-8).*(...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
index exceeds matrix dimensions??
while a<=size(dH_df,1) && dH_df(a,b)<0.80 %line 199 If you want to find the row position of values between 0.80 and 0.85, ...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
I set up a GUI with guide, but the input variables are not getting set.
Do you mean you want to pass parameters to set the initial of, say, an editbox or two? If so, you can access anything passed in...

presque 15 ans il y a | 0

Réponse apportée
File name is too long using IMREAD in GUI
I assume your error is on the line defining I. Put this right before that line and look at what is being passed. You are likel...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Setting Array Value
Another: A = repmat([1,3,1,7],3,1) % change the 3 to 5 to get 5 rows, etc...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Finding a minumum range of sequential values
What else does your data look like? Is it ones and zeros? Integers only? A single row vector, or matrix? Give all the detail...

presque 15 ans il y a | 2

| A accepté

Réponse apportée
Integration problem with a power/time curve
trapz(x,y) should give you W-Day. So take that answer and multiply by 24.

presque 15 ans il y a | 0

| A accepté

Réponse apportée
plotting selected lines from a matrix
I still think you meant to plot the columns, not the rows. But this works for me: test = repmat(magic(3),[1 1 4]); te...

presque 15 ans il y a | 1

Réponse apportée
Splitting a string of numbers and '|'
str = '1 | 2'; S = regexp(str,'\d+','match') Now S is a 1-by-2 cell array. strcmp(S{1},'1') strcmp(S{2},'2')

presque 15 ans il y a | 2

| A accepté

Réponse apportée
Manipulating graph interactively
I am not familiar with this function, but you could put a slider in the same figure with the axes and have the callback for the ...

presque 15 ans il y a | 0

Réponse apportée
waitbar + surf functions. are they incompatible?
From the help for WAITBAR (always a good place to look with any funciton!), we have this: h = waitbar(0,'Please wait...'); % ...

presque 15 ans il y a | 0

Réponse apportée
Cut and re-join strings
Rather than using a verbal description, show us what you want. For example, if you start with these: pat = 'MATLAB'; st...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Using handle graphics for more global variables
G = guidata(gcbf); % Get the application data G.newvariable = 5; % Store new variables in this data. G.newvariable2 = ...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Update Graph With Data Input
You need to put the code which updates the plot in the slider callback. After this code, put a call to DRAWNOW.

presque 15 ans il y a | 0

| A accepté

Réponse apportée
saving or not matrices
if ~all(isnan(A(:))) % Do the saving. end But it seems to me that *_if_* the only source of nans is from when you rep...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Matlab function
If you have an explicit function of one variable, you might have luck with a Newton's method <http://www.mathworks.com/matlabcen...

presque 15 ans il y a | 1

Réponse apportée
How do I round to the nearest arbitrary, enumerated value in MATLAB?
One approach: roundTargets = [0 2.7 8 11.1]; v = [0.1 2.2 1.6 7.3 10]; vRounded = interp1(roundTargets,roundTargets,v...

presque 15 ans il y a | 5

| A accepté

Réponse apportée
A second basic 'Find' question
idx = findstr([0 data>=X],[0 1]); idx = idx(ismembc(idx,findstr(data>Y,ones(1,N))))

presque 15 ans il y a | 1

| A accepté

Charger plus