Answered
Segmentation violation while running mex file
After some speculations, this might be (one of) the crashing point(s): mwSize *dimsOut; ... dimsOut[0] = 1; dimsOut[1] =...

7 years ago | 1

| accepted

Answered
how can i solve this ,can anyone provide me with code? whats wrong with my code ?
The code fails in the 2nd line, which ends with: ... isscalar(day) && day>0 && ar What is the meaning of "ar"? After checking...

7 years ago | 2

Answered
Running 2019a, I get the following Warning "MATLAB:dispatcher:cannotFindFunction Cannot find function "on"."
Do you mean: dbstop if error instead of "on" ? Google can find only 38 matchs for Matlab "dbstop on error" so I guess, that...

7 years ago | 0

Answered
unable to perform assignment because left and right sides have a different number of elements
The error message is clear: The number of elements of the left and righ side differs. Try this: % signal_1(1024:2047) = pseudo_...

7 years ago | 1

| accepted

Answered
Segmentation violation while running mex file
Prefer mxGetScalar instead of SmoothX=*mxGetPr(field_value); Mixing integer types can cause serious troubles: int nx; ...

7 years ago | 0

Answered
Checking a specific column in a matrix with a specific row,column in another matrix
I've simplified the code at first: A = [1 2 1 2 5 2 1 2; 3 4 5 6 7 8 2 1]; B = [1 2;0 1; 2 4; 3 7; 0 5; 1 3; 2 4...

7 years ago | 0

| accepted

Answered
Exporting plot3 and fill3 in pdf format renderer issue
As you can see, PDF is not appropriate for 3D graphics. There are some workarounds, see: https://www.mathworks.com/matlabcentra...

7 years ago | 0

Answered
Create a function that receives two vectors and returns a vector that are the elements of a vector that are not in the other vector
A brute approach, which creates a huge temporary matrix for large inputs: u_origin = [1 7 23 45 62]; v = [45 35 1 15]; ...

7 years ago | 0

Answered
Running a function multiple times and recording outputs for each of the runs in one table (file)
You can simply create a loop and call this code 500 times. for k = 1:500 brzina_vjetra; end But fix the code at first - ...

7 years ago | 0

Answered
Graphs plotting blank - unsure why and how to fix
I guess, the problem is here: for time = 0:dt:Period ... end plot(time, displacement_data); Now the value of time i...

7 years ago | 1

Answered
Input data using GUI
Do you want to create the GUI in AppDesigner, in GUIDE or programmatically? With the last one: function Data = YourGUI H.Fig ...

7 years ago | 2

Answered
How to set alpha value (transparency) of legend to match alpha in fill plot using automatically generated legend?
Maybe this helps: https://www.mathworks.com/matlabcentral/answers/354592-how-to-set-legend-for-filled-areas

7 years ago | 0

| accepted

Answered
how to fix subscripted assignment dimention mismatch in my coding?
The posted code works as expected. Please confirm, that this causes the same problem: M = rand(250, 306, 8); hs = slice(M,[],[...

7 years ago | 0

Answered
how to remove zeros from a cell array
for j1 = 1:length(xcor1) for i1 = 1:9 Data = DistanceInClass2{j1}{i1}; if ~isempty(Data) Dat...

7 years ago | 0

| accepted

Answered
How to extract specific column from multiple csv and store as different columns as output table ?
Output = table(); for kk = 1:numel(list) filename = list(kk).name; data = readtable(fullfile(list(kk).folder, fil...

7 years ago | 0

Answered
Get max, min and precision of a fi
a = fi(pi, true, 16, 12); xi = intmax(a) This is code taken from https://www.mathworks.com/help/fixedpoint/ref/intmax.html , ...

7 years ago | 0

| accepted

Answered
Strange behavior of the editor in the forum
I can confirm, that the paragraphs are shown correctly now without additional blank lines on top of it. The screen does not scro...

7 years ago | 0

Answered
Finding the average number of guesses
In the lines: fprintf('Too low\n', guess); and fprintf('You guessed it! Congrats!\n', right) there ...

7 years ago | 0

Answered
licence manager error-9
I recommend to use the search function of this forum and check one of the many threads about tis topic. e.g.: https://www.mathw...

7 years ago | 0

Answered
Disable suggested function in command window on typo
Maybe this helps: https://www.mathworks.com/matlabcentral/fileexchange/51201-full-command-line-help

7 years ago | 1

Answered
Mex file compilation given include files and library files
Replace mex -g -I C:\Program Files\UHD\include\uhd\multi_usrp.hpp ... by mex -g -I "C:\Program Files\UHD\include\uhd\multi...

7 years ago | 0

| accepted

Answered
H must be the handle to a figure or figure descendent?
Use the debugger to analyse the problem. Type e.g. in the command window: dbstop if error Run the code again and when Matlab s...

7 years ago | 0

| accepted

Answered
How to access data from multiple gui files in one gui file?
% Restrict the search to figures: Process1H = findobj(allchild(groot), 'flat', 'tag', 'process1'); % Maybe you mean the hand...

7 years ago | 0

Answered
uiget file multiselect images
FigH = figure; for k = 1:4 AxesH = subplot(2, 2, k); img = rand(200, 200, 3); % Some test data image(AxesH, i...

7 years ago | 0

Answered
error when integrating using a loop
This code let the output grow iteratively, what is extremely inefficient: BendingMoment1=[0 0]; for k=1:Length*1000 Bendin...

7 years ago | 0

| accepted

Answered
savefig error in text
The error message is clear: At least one of the provided values is not a numerical scalar. So how doyou call this function? Chec...

7 years ago | 0

Answered
How to duplicate a 2000 x 200 matrix n times
You mean: repmat(A, 61, 1) In your example, you have "repeated" the input [2 x 3] matrix to the output [3 x 3] and call thims ...

7 years ago | 1

Answered
TRANSPOSE(.') / RESHAPE too much TIME CONSUMING--> Looking for ALTERNATIVE
Is D pre-allocated? This is an important detail if runtime matters. permute(DistPT(:,j),[2,1]) ?! What about: DistPT(:,j).' ? ...

7 years ago | 2

Answered
how can i convert c code c code to Mat lab code?
This is an invalid C code. You use e.g. x1, x2, size, without defining it. It is meaningless to post the conversion of invalid C...

7 years ago | 0

Answered
Create Matrix with zeros, ones and some numbers.
With 2 "numbers" only: c = ['0 0 0 0 0 1 ', ... '0 0 0 0 0 1 ', ... '1 2 3 4 5 1 ', ... '0 2 4 6 8 1 ', ... ...

7 years ago | 1

| accepted

Load more