Gelöst


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

etwa 11 Jahre vor

Gelöst


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

etwa 11 Jahre vor

Beantwortet
MySql datainsert/ fastinsert problem
Hi Sal, when you write a single entry to one column, then this will add a row to your table, and all the other columns will g...

etwa 11 Jahre vor | 0

Beantwortet
Assign value to array structure
Hi, this should work: valuesCell = num2cell(ValuesToAssign); [StructArray.field_1] = valuesCell{:}; Titus

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
Problem with HitTest. I can not zoom on ax1 when ax2 is on top of it. The code works in Matlab 2012b.
Hi, I'm not yet sure, why this happens. Programmatically you can change the behavior to the desired as follows: hz = zoo...

etwa 11 Jahre vor | 0

Beantwortet
Crank-Nicolson finite difference method - Error: Function definitions are not permitted in this context.
You need to save the code to a file, then call it ... Titus

etwa 11 Jahre vor | 0

Beantwortet
Some tunable variables are missing in generated S-function mask
Hi Benjamin, note, that there are blocks in Simulink that don't allow the value to be tunable (all sample time related parame...

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

Beantwortet
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) %...

etwa 11 Jahre vor | 2

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 2

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 3

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

etwa 11 Jahre vor | 0

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

Beantwortet
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[...

etwa 11 Jahre vor | 1

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
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

etwa 11 Jahre vor | 7

| akzeptiert

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

etwa 11 Jahre vor | 0

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

etwa 11 Jahre vor | 0

Mehr laden