Risolto


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

oltre 10 anni fa

Risolto


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

oltre 10 anni fa

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 1

| accettato

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

oltre 10 anni fa | 0

Risposto
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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 2

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 2

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 3

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 1

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 1

| accettato

Risposto
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

oltre 10 anni fa | 7

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

Carica altro