已解决


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

9 years 前

已解决


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

9 years 前

已回答
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...

9 years 前 | 0

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

9 years 前 | 1

| 已接受

已回答
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...

9 years 前 | 0

已回答
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

9 years 前 | 0

已回答
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...

9 years 前 | 0

已回答
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...

9 years 前 | 0

已回答
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) %...

9 years 前 | 2

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 0

已回答
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...

9 years 前 | 0

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 0

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

9 years 前 | 0

| 已接受

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

9 years 前 | 0

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

9 years 前 | 2

| 已接受

已回答
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...

9 years 前 | 0

已回答
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...

9 years 前 | 3

已回答
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...

9 years 前 | 0

| 已接受

已回答
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...

9 years 前 | 0

已回答
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...

9 years 前 | 0

已回答
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[...

9 years 前 | 1

| 已接受

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

9 years 前 | 0

已回答
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...

9 years 前 | 1

| 已接受

已回答
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

9 years 前 | 7

| 已接受

已回答
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...

9 years 前 | 0

已回答
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. ...

9 years 前 | 0

加载更多