Réponse apportée
Plot different colors while using loops.
You can make a cell array of your chosen colors, then: C = {'k','b','r','g','y',[.5 .6 .7],[.8 .2 .6]} % Cell array of colro...

presque 15 ans il y a | 17

| A accepté

Réponse apportée
How to find vector elements between two values, efficiently
Do you need the actual indices or the values? If you only need the values, then it would probably be faster to do: A(A(:...

presque 15 ans il y a | 4

| A accepté

Réponse apportée
Multiple choices in a listbox
If you set 'min' to 0 and 'max' to 10, you will be able to select multiple strings. Once you have that you can get the choices ...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
how to plot multiple graphs on one figure
There is probably a better way to do this, but here is what I did. I made a text file that looks like this (as you describe): ...

presque 15 ans il y a | 0

Réponse apportée
Plot data from a double class array
plot(array(:,1),array(:,2)) If you don't like that for some reason, you could do: ac = mat2cell(array,size(array,1),[1 1])...

presque 15 ans il y a | 2

| A accepté

Réponse apportée
GUI text box - Replacing a word entered in the text box.
str = '10*x(n)' str2 = strrep(str,'n','1')

presque 15 ans il y a | 0

| A accepté

Réponse apportée
how to solve a system of equations?
% Choose some values: J = rand(21); B = rand(21,1); F = rand(21,1); % Calculate X based on J*X = J*B-F X = J\(J*...

presque 15 ans il y a | 0

Réponse apportée
Export level along with coordinates from contour figure datatips?
Although I think you could alter the built-in M-code to do what you want, I would probably do this instead. I called this: ...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
How do I fix the code of my program
I am not sure what you are trying to say about a mean value, but I think you are basically wanting to make this: theta = l...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Count frequency of number in set time period
responses = round(rand(1,10)*2) % An example data set times = 1:10; % Example time set... % Count responses equal to 1...

presque 15 ans il y a | 0

Réponse apportée
Double summation with vectorized loops
Here is a vectorized version, but I must say that I would have probably just went with Jan's FOR loop. It seems you need to see...

presque 15 ans il y a | 1

Réponse apportée
How do I avoid creating intermediate variables?
Is your complaint about the extra typing, or the extra variable in the workspace? If the latter, then one way to avoid this kin...

presque 15 ans il y a | 0

Réponse apportée
zero crossing
x = 0:.01:2*pi; f = @(x) sin(x).*cos(x); % A randomly chosen function. % Next find the zero crossings of f(x)... rt = [...

presque 15 ans il y a | 1

Réponse apportée
Set BackgroundColor to 'none'
c = get(hparent,'color') % For a figure. 'backgroundcolor' for others. set(hobj,'backgroundcolor',C)

presque 15 ans il y a | 0

Réponse apportée
using function input to create a title
N = 5; % An integer to use in the string below... str = sprintf('nameoffile%i.dot',N) % Make a string. % Use the above f...

presque 15 ans il y a | 0

| A accepté

Réponse apportée
Integration by matlab
Use this instead: M=quadv(X,0,(2*pi)); % % % In the future, you need to be more specific than just saying that you have ...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Matlab Percentile function VS excel percentile function
I don't see a PERCENTILE function in MATLAB. Is it a custom function you wrote?

presque 15 ans il y a | 0

Réponse apportée
Simplifying MODULUS code
The way you have defined B (and Space), your FOR loops are equivalent to these: for r = 1:Rows % For every row in grid ...

presque 15 ans il y a | 0

Réponse apportée
ButtonGroup
The lines I changed are marked with a %% function [] = test(varargin) N.fh=figure('units','pixels',... 'posit...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Trigonometric Interpolation
clc; N = 6; x = (2*pi*(0:N-1))./N; y = cos(x); x_fein = -2:0.01:2; yy = triginterpol(y, x_fein); plot(x_fein, yy/N...

presque 15 ans il y a | 0

Réponse apportée
How to print axes area on GUI?
This works on my computer, you may have to tweak a few things. close all figure('units','pix','pos',[200 200 850 750]) ...

presque 15 ans il y a | 1

Réponse apportée
How send to back patch objects in a graph?
Simply change the order of objects in the children property of the axes object. set(gca,'children',flipud(get(gca,'children'...

presque 15 ans il y a | 11

| A accepté

Réponse apportée
horzcat different size rows; zero padding
A = [1,2,3,4].'; B = [1 2 3 4 5 6].'; C = zeros(6,2); C(1:length(A),1)= A % Fill first column with A C(1:length(B),2)...

presque 15 ans il y a | 0

Réponse apportée
Shannon fano coding
There are *_several_* errors in this code. # Missing opening parenthesis on line 2. # Extra comma on line 2 (or missing first a...

presque 15 ans il y a | 0

Réponse apportée
Length of the longest continuous string of the same number
Here is one way to do it. A = [5;5;1;2;3;4;5;5;5;5;6;7;8].'; % Transpose to row vector. [M,V] = regexp(sprintf('%i',[0 d...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Convert RGB to GRAY
Perhaps you mean RGB2GRAY. I don't know of any RGBTOGRAY function.

presque 15 ans il y a | 0

| A accepté

Réponse apportée
how do i write a function which recognize user-defined functions and plots the results in my gui
The error from t^2 is because the user did not enter a vectorized function. The user should enter: t.^2 (notice the dot). How...

presque 15 ans il y a | 1

Réponse apportée
Contributors metainfo: reputation and more
Congrats to Walter for reaching 3,000 points - a double editor! O.k., so it is a little early (2999 points as of now), but I ...

presque 15 ans il y a | 0

Réponse apportée
saving a newly created colormap
Two ways you could go about this. First, from the command line: save mycolormap cmapnew Then make a new function: func...

presque 15 ans il y a | 3

| A accepté

Réponse apportée
Waitbar won't close
Use: delete(h.waitbar); instead of close(h.waitbar); Basically what happens is that when you set the CreatCancelBtn pro...

presque 15 ans il y a | 2

| A accepté

Charger plus