Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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]...

plus de 9 ans il y a | 1

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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);

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
remove duplicate rows from a matrix
unique(sort(A,2), 'rows')

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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.

plus de 9 ans il y a | 1

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

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 3

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Why do I get wrong results with power of 2?
Use .^ M = [1 2; 3 4]; 1.61803.^M

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 1

Réponse apportée
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/>

plus de 9 ans il y a | 0

Réponse apportée
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)

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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, ...

plus de 9 ans il y a | 0

Réponse apportée
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; ...

plus de 9 ans il y a | 2

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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)) ...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
Hi, the code is a portfolio of call(long) and put(short) options on the same asset both being out of the money with same time to maturity, using the delta normal and delta gamma normal methods to compute the value at risk. The error is in line 21
I get a different error, namely Error: File: portfolio.m Line: 67 Column: 31 Unexpected MATLAB expression. which is ...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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),

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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, :) = [];

plus de 9 ans il y a | 1

Réponse apportée
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)

plus de 9 ans il y a | 0

| A accepté

Charger plus