Gesendet


N_PERMUTE_K
All possible permutations of the elements of set N, taken K at a time, with repetition.

fast 14 Jahre vor | 1 Download |

4.33333 / 5
Thumbnail

Beantwortet
To set value based on condition in a matrix
Here is an example. % First make the matrix and get the needed numbers... A = zeros(ceil(rand(1,2)*10)+1); % The matri...

fast 14 Jahre vor | 0

Beantwortet
Is this a Possible MATLAB bug? (Further strange Behavior)
According to the documentation, " _The MATLAB software creates the ans variable automatically when you specify no output argu...

fast 14 Jahre vor | 1

Beantwortet
Using ' findobj ' command and then determining the figure objects from the list of handles
You can narrow your search to specific object types in only specific figure windows. findobj(1,'type','line') % Finds only ...

fast 14 Jahre vor | 0

Beantwortet
how to avoid using num2cell when dealing to structure arrays?
There is a way to do it, and it will be faster (at least it is here): for ii = 1:length(b) a(idx(ii)).a = b(ii); ...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
Summing within an array to change the size
Here is one way to do it: A = magic(6); cellfun(@(x) sum(x(:)),mat2cell(A,2*ones(1,3),2*ones(1,3)))

fast 14 Jahre vor | 0

Beantwortet
how speed up or avoid loops
This is much faster. Note that you are masking a very valuable MATLAB function by naming a variable 'sum' in your loop! Please...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
how to throw out certain intervals.
Is this what you want? X = [ 2 3 4 57 36 2 ]; Y = X(X>10) I take it this is what you are after because of a loop you ...

fast 14 Jahre vor | 0

Beantwortet
Using i and j as variables
Yes, I ran into much trouble in my early days of MATLAB using i and j as indices in signal processing and data manipulation code...

fast 14 Jahre vor | 5

| akzeptiert

Beantwortet
How can I quickly refer to various object handles in my GUI?
Here is how I handle situations like these. I store all handles to a specific type in a structure with a fieldname correspondin...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
Double Loop iterations doubt
Is this what you mean? if ~mod(i,12) j = j + 1; end I am assuming here that j is set outside the loop you sho...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
Search and Compare Arrays
I assume the temperatures in B exactly match those in A? In other words, you are not interpolating. First the FOR loop you req...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
Problem with markers & dashed lines in figures containing both plot and fill
This is a problem with the opengl renderer. When you have a transparency, you are using opengl, and it can be buggy. To see th...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
Error: Not enough input argument (line 6)
The error is not in the function, but in the way you called it. You called it with no input arguments.

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
changing an image to rgb format
A png is already 3D. I have an image named IMG.png in my directory. Now look: >> X = imread('IMG.png'); >> whos ...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
Which solver to use? I cannot get an answer, though I know there is one.
Use: ROOT = solve(lhs-rhs,'L'); There are other roots. You might just want to use FZERO: fzero(@(x) subs(lhs,x...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
Slider for Multiple Plots in GUIDE
Here is a simple example GUI. Note that the same principle applies in GUIDE. function [] = slider_plot() % Plot dif...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
Generate a matrix of 1 and 0
Is this what you mean: A =[4 5 3 2 4 2 1 4]; U = unique(A); B = zeros(max(U)); for ii = U B(A==ii,ii) =...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
GUI GUIDE Error with Map
You clear long and lat, then immediately try to use them. This is your error. You also rely on Poofing variables into your wor...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
Accessing cell array via factor/index
I assume you mean that the each row in the third column contains one of 'fs','pre','sv',or 'to', not all 4! This snippet finds ...

fast 14 Jahre vor | 0

Beantwortet
how to write a loop
Instead of using: for i=1 use if i==1 (And it is generally not recommended to mask MATLAB functions in your co...

fast 14 Jahre vor | 0

Beantwortet
How can I forecast an integer related to other 5 numbers?
Here is another way that uses no toolbox. Find the weights.... % First the data. D = [33 48 47 68 79 6; 26 32 3...

fast 14 Jahre vor | 0

Beantwortet
Why does dir('*.mat') not list all of the .mat files in directory?
Are you sure about those files being in there? Does WHAT see them (type: what) in there? D = dir; length(regexp([D(:).n...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
How can I fill a plot section from a single x,y coordinates?
I would fill it with a patch object. line([1 1],[0 100],'color','b','linewidth',3); hold all verts = [[0;1;1;0],[...

fast 14 Jahre vor | 0

| akzeptiert

Problem


Find the repeating decimal pattern!
Write a function that takes one double input value and returns only the repeating decimal, if any, as a string. Only decimals f...

fast 14 Jahre vor | 2 | 15 Lösungsvorschläge

Beantwortet
while loop; a small problem
This loop, as you written it, should always 'get stuck' because k does not change inside the loop. What are you trying to do wi...

fast 14 Jahre vor | 0

Beantwortet
How can I get the index of the selected item in a pop-up menu within a uitable?
I don't see how to do this. The best I can suggest to you is to use <http://www.mathworks.com/matlabcentral/fileexchange/14317-...

fast 14 Jahre vor | 0

Beantwortet
Converting rad to deg in a static text box GUI?
The problem is that you are passing ANGLEDIM a string and expecting a string output. It takes and returns doubles, not strings....

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
How do I correct this plot code?
Whenever you mean to multiply (or divide) a vector by a vector on an element-by-element basis, you must use the (.*) or (./) ope...

fast 14 Jahre vor | 0

Mehr laden