Respondida
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...

más de 9 años hace | 0

| aceptada

Respondida
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]...

más de 9 años hace | 1

Respondida
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...

más de 9 años hace | 0

Respondida
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);

más de 9 años hace | 1

| aceptada

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

más de 9 años hace | 0

| aceptada

Respondida
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.

más de 9 años hace | 1

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

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 3

Respondida
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...

más de 9 años hace | 0

| aceptada

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

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 1

| aceptada

Respondida
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...

más de 9 años hace | 2

| aceptada

Respondida
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...

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 0

| aceptada

Respondida
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...

más de 9 años hace | 1

Respondida
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/>

más de 9 años hace | 0

Respondida
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)

más de 9 años hace | 0

| aceptada

Respondida
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, ...

más de 9 años hace | 0

Respondida
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; ...

más de 9 años hace | 2

Respondida
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...

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 0

Respondida
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...

más de 9 años hace | 1

| aceptada

Respondida
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...

más de 9 años hace | 0

Respondida
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)) ...

más de 9 años hace | 1

| aceptada

Respondida
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...

más de 9 años hace | 0

| aceptada

Respondida
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...

más de 9 años hace | 0

Respondida
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),

más de 9 años hace | 0

| aceptada

Respondida
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, :) = [];

más de 9 años hace | 1

Respondida
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)

más de 9 años hace | 0

| aceptada

Cargar más