Respondida
Find minimum of double-variable function on fixed interval
Hi, just to be sure: your y is dependent both on G and r and you want to minimize on the square [0..1]x[0..1]? In this cas...

alrededor de 9 años hace | 0

Respondida
How to get each plane of a 24 bit plane image?
Hi, maybe this function could help? function p = getPlane(im, idx) % look for planes 1..24 assert(idx>0 && idx<=24) %...

alrededor de 9 años hace | 2

Respondida
What does it mean when they wrote something like this: f{t} = @(z) f_m(z, m(t)) :
Hi, search the documentation for function_handle The first hit is what you are looking for. In short f_m = @(z,c...

alrededor de 9 años hace | 0

| aceptada

Respondida
Removing certain lines of text from a cell array
Hi, that should be fairly straight forward: % find the indices of ESO idx = strncmp(N1, 'ESO', 3); % and remove th...

alrededor de 9 años hace | 0

| aceptada

Respondida
Mex compiled function, used to compute set intersection and difference, keeps crashing
Hi, I'm not 100% sure why it crashes, but that's at least a good way to create memory leaks ;-). You should replace the mx...

alrededor de 9 años hace | 0

Respondida
The expression to the left of the equals sign is not a valid target for an assignment.
Hi, that's the maple notation. Use the following: syms x S=int(sin(cos(x)), x, 0, 1) Then it should work, although t...

alrededor de 9 años hace | 0

Respondida
Unusual set_param error with system
Hi, note, that there is a line break. This should work: set_param(sprintf('R_edge_detect/Subsystem\n/Filt'), 'SampleTime...

alrededor de 9 años hace | 0

| aceptada

Respondida
Is there a way to have a MATLAB script run automatically as a result of some event?
Hi Nicholas, the simplest I guess is to create a timer that * looks for a new file * starts your script, if it finds one...

alrededor de 9 años hace | 0

| aceptada

Respondida
Global Optimization not returning correct values
Hi Jacob, you mean similar to this? x = 1:5; y = polyval([1 0.5 0.25], x); polyfit(x, y, 2) ans = 1.0000 0.50...

alrededor de 9 años hace | 0

Respondida
How can I calculate a Integral.
Hi, use the trapz function: trapz(Time, Error) Titus

alrededor de 9 años hace | 0

| aceptada

Respondida
Cant find roots with fzero
Hi, either do what Torsten suggests, or create a function handle instead of using syms: Qbalance = @(T) (258511136443766...

alrededor de 9 años hace | 0

Respondida
Unexpected matlab expression???? How to Solve???? - URGENT!!!!!
a = @(m) sqrt(...) Titus

alrededor de 9 años hace | 2

| aceptada

Respondida
How can do intersection and union of two vectors?
Hi, did you try to enter union or intersect in the documentation search? It should give you at least for the intersection a g...

alrededor de 9 años hace | 0

Respondida
How to convert binary image to RGB image in matlab?
Hi, you need to replicate the bw image for each color channel, convert to uint8 and multiply by 255: J1 = 255 * repmat(u...

alrededor de 9 años hace | 3

Respondida
I have a 1000 element vector. I want to know if it has got any of its 2 or more elements equal. Is there a command to check this?
Hi, the easiest is to use unique x = [1 1 2 3]; if numel(x)~=numel(unique(x)) disp('There are repetitive element...

alrededor de 9 años hace | 0

| aceptada

Respondida
Can I call a bash shell script (using cygwin) through matlab?
Hi, you can use the system function to call your shell script. Something like location = 'Germany'; system(['yourshel...

alrededor de 9 años hace | 0

Respondida
How to change directory to write-able one and still be able to compile using a C- compiler?
Hi, take a look <http://www.mathworks.com/support/compilers/R2015a/index.html here> for supported C-compilers (left is "previ...

alrededor de 9 años hace | 0

Respondida
Matlab Coder C++ matrix multiplication issue
Hi, note that MATLAB uses column format for storing arrays, so you need to initialize double X[]={2,5,4,6}; double Y[...

alrededor de 9 años hace | 1

| aceptada

Respondida
how to make function that return struct vector whose elements are days of month
Hi Muhammad, a hint: doc weekday Titus

alrededor de 9 años hace | 0

Respondida
Given a named function, how can I call this function, and not the subfunction of the same name?
Oliver, what about this: feval(evalin('base', '@(x) help(x)'), 'help') This works fine. And as you noted yourself...

alrededor de 9 años hace | 1

| aceptada

Respondida
How to check the existence of a non-existent handle
Hi Klaus, I guess isfield(handle, 'a') && ishandle(handle.a) is what you are looking for ...? Titus

alrededor de 9 años hace | 7

| aceptada

Respondida
Given a named function, how can I call this function, and not the subfunction of the same name?
Hi Oliver, although this is not an answer to your question it might help anyway: this is one of the reasons to use function h...

alrededor de 9 años hace | 0

Respondida
Simulating C MEX S-Function causes crash (Level 2)
Hi, the <http://www.mathworks.com/help/matlab/troubleshoot-mex-files-1.html documentation> describes how to debug mex files. ...

alrededor de 9 años hace | 0

Respondida
Subplot with varying number of plots
Hi, no, you can't insert the figure, but you can do something that should look like what you want. You can "combine" subplots...

alrededor de 9 años hace | 2

| aceptada

Respondida
How to obtain sum of RGB color values of a pixel?
Hi, something like sum(I, 3) ? Titus

alrededor de 9 años hace | 0

| aceptada

Respondida
Managing {} indexing in SUBSREF/SUBSASGN overloads.
Hi Cedric, very tricky question, indeed. I gave it a try and came up with this subsref: function [varargout] = subsref(...

alrededor de 9 años hace | 2

Respondida
Plotting 1/x correctly
Adding to Thorsten's answer: you need to put x on the x axis while plotting: plot(x, 1./x); Titus

alrededor de 9 años hace | 0

Respondida
Matrix with Bell Triangle
O.k., when there is a full solution, I'm happy to share mine as well ;-) function B = bell(n) B = zeros(n); B(1,1) = 1; ...

alrededor de 9 años hace | 3

Respondida
How do I convert a cell array of char to a single plot title?
Hi, use sprintf to add a carriage return at the end of each line: title(sprintf('%s\n', labels{:})) Titus

alrededor de 9 años hace | 0

| aceptada

Respondida
polyfit doesn't fit the data
Hi, I guess it's another problem here: note, that if you call polyfit with [p,s,mu] = polyfit ... you get the scaled ...

alrededor de 9 años hace | 0

| aceptada

Cargar más