Beantwortet
Undefined function or variable error
Both commands are part of the image processing toolbox. Maybe you have not installed this toolbox in your current version? To ch...

fast 10 Jahre vor | 0

| akzeptiert

Beantwortet
Concatenate arrays horizontally n matrix by loop
A(:,:,1) = [1 2 3; 2 4 6]; A(:,:,2) = [4 5 6; 8 10 12]; A(:,:,3) = [7 8 9; 14 16 18]; A(:,:,4) = [10 11 12; 20 22 24]...

fast 10 Jahre vor | 1

Beantwortet
choose and change data partially
theta = linspace(0, 2*pi); idx1 = theta >= pi/2 & theta <= 3*pi/2; idx2 = theta >= 3*pi/2 & theta <= 2*pi; theta...

fast 10 Jahre vor | 0

Beantwortet
Generate numeric code based on string value
c = {'a_abc_ABC', 'a_def_ABC', 'b_def_ABC', 'a_abc_ABC', 'a_def_ABC'}; [~, ~, c_num] = unique(c);

fast 10 Jahre vor | 1

| akzeptiert

Beantwortet
remove duplicate rows from a matrix
unique(sort(A,2), 'rows')

fast 10 Jahre vor | 0

| akzeptiert

Beantwortet
Can I call functions inside a parfor loop?
If the results of the computations in the loop are independent of each other, you can use parfor.

fast 10 Jahre vor | 1

Beantwortet
having problem to call m.file
You can use switch to compare a string variable to different other constant strings: switch exparx case 'expfun1cfd' ...

fast 10 Jahre vor | 0

Beantwortet
Replacing values in a Matrix
[Aval, ~, indAval] = unique(A); Define the new values. Values are ordered from the smallest value to replace with to the lar...

fast 10 Jahre vor | 3

Beantwortet
How can I read a text file and then take out specific words in that text file?
fid = fopen(filename); T = textscan(fid, '%s'); T = T{1}; fclose(fid); idx = strcmp(T, 'word_to_take_out'); N...

fast 10 Jahre vor | 0

| akzeptiert

Beantwortet
Why do I get wrong results with power of 2?
Use .^ M = [1 2; 3 4]; 1.61803.^M

fast 10 Jahre vor | 0

Beantwortet
how to do a command line only if it is possible?
if exist('previous_setting') end If previous_setting is variable, use exist('previous_setting', 1) if it is an...

fast 10 Jahre vor | 1

| akzeptiert

Beantwortet
Searching for line and circle intersection.
If P11 and P12 are the intersection points with circle 1, and P21, P22 are those with circle 2, you compute the distances betwe...

fast 10 Jahre vor | 2

| akzeptiert

Beantwortet
How to bin 2d data?
Have a look at this: D = dlmread('/Users/hansen/Downloads/PC1-PC2.txt'); Nbins = 37; H = hist3(D, {linspace(-3,3,Nbi...

fast 10 Jahre vor | 0

Beantwortet
How can I automatically adjust the radius of concentric coronas? code is given below
You can considerable simplify the plotting of the nodes x = 10:10:100; % x = 0.1:0.1:1; % uncomment to choose a differen...

fast 10 Jahre vor | 0

| akzeptiert

Beantwortet
Drawing circles with multi-colored patterns in the annulus
You can generate your circles using my function plot annulus plotannulus(0, 0, 5, 10, [0 0 1; 1 1 0], deg2rad(90)) plota...

fast 10 Jahre vor | 1

Beantwortet
Udefined function or method 'FLOPS' for input arguments of type 'double'. Error in ==> expfun1cf1 at 4 FLOPS(0);
<https://www.stat.uchicago.edu/~lekheng/courses/302/flops/>

fast 10 Jahre vor | 0

Beantwortet
how to check if the row of the matrix equal zero or not
k=m; k(all(m==0,2),:)=[] % delete that row and create new vector (k)

fast 10 Jahre vor | 0

| akzeptiert

Beantwortet
memory and large arrays
If you clear the variables that you do not need Matlab will less likely run out of memory. But if you don't have memory issues, ...

fast 10 Jahre vor | 0

Beantwortet
In a cell how do I extract a specific range of values from a few columns that have a certain value in another column?
You can also achieve this without accumarray or splitat, using a for-loop. c ={'Bob', 1, 100; 'Bob', 3, 200; 'Bob', 4, 500; ...

fast 10 Jahre vor | 2

Beantwortet
Error using function: Not enough input arguments.
You have to call the function with an argument n: >> myfirstmatlab(4) Note that you can write your program in a single li...

fast 10 Jahre vor | 0

Beantwortet
get the correct data of intersection in plot
You can compute the first intersection of each curve with a horizontal line of height 95. There are various ways to compute inte...

fast 10 Jahre vor | 0

Beantwortet
Why does changing ydir to 'reverse' change xdir and axis locations, but not ydir?
Probably you messed up the first and the second plot. gca may give you the axes of the right plot, and then you try to reverse t...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
how to convert Decimal degree to degree minutes decimal?
degdegree = 32.533; % sample value deg = fix(degdegree); mindec = 60*(degdegree- deg); if deg > 0 NSstr = 'N...

etwa 10 Jahre vor | 0

Beantwortet
how to find maximum and minimum in a matrix
A= [0.1 0.5 0.3 0.9 0.4 0.8 0.4 0.2 1 0.7 0.2 0.6 0.7 1 0.2 0.9] idx = A(:,1)==max(A(:,1)) ...

etwa 10 Jahre vor | 1

| akzeptiert

Beantwortet
Convert Minutes to Seconds
The help of minutes tells us If X is a numeric array, then M is a duration array in units of minutes. If X is a duration...

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
what exactly this Logical indexing refering to?
When you ask for [C{logical([1 1]),:}] which is the same as [C{:,:}] you ask Matlab to combine variables of unlike classes, name...

etwa 10 Jahre vor | 0

Beantwortet
Is the equality min(a/(b+1), c/(d+1))=min(a,c)/(min(b,d)+1) hold?
It does not hold. Try a = 1; b = 8; c = 4; d = 3; min(a/(b+1), c/(d+1)) min(a,c)/(min(b,d)+1),

etwa 10 Jahre vor | 0

| akzeptiert

Beantwortet
How do I remove outliers from a matrix?
idx = bsxfun(@gt, R, mean(R) + std(R)) | bsxfun(@lt, R, mean(R) - std(R)); idx = any(idx, 2); R(idx, :) = [];

etwa 10 Jahre vor | 1

Beantwortet
Splitting up and N size array into parts
N = 613; P = 10; X = rand(N, 1); r = diff(fix(linspace(0, N, P+1))) C = mat2cell(X, r, 1)

etwa 10 Jahre vor | 0

| akzeptiert

Mehr laden