Answered
Plot not shown in for loop
Exactly. Give Matlab a chance to update the output by inserting the command: drawnow inside the loop.

4 years ago | 0

Answered
How to insert an image into an image in matlab ?
image1 = rand(100, 200, 3); % Noisy image2 = ones(20, 30, 3); % White s1 = size(image1); s2 = size(image2); image3 = i...

4 years ago | 1

Answered
Is there a way to convert binary with Don't care to corresponding decimal values in MATLAB?
You can ectract the wanted bits by bitget such that the ignored bits simply vanish.

4 years ago | 0

Answered
What's the link between the size of XData and the original graphic?
The values of the line have a range until 22028.5, which is the "2x10^4". The number of values can be 1025. This means, that t...

4 years ago | 0

| accepted

Answered
How to generate a matrix with entries of -1 and +1 of size N x M where all the columns are unique ?
N = 3; M = 8; R = 1 - 2 * rem(floor(pow2(1-N:0).' .* (0:M-1)), 2)

4 years ago | 0

Answered
Is it possible to download MATLAB R2015b 32-bit?
Yes. If you have a license for a current version, you can download and install an old version also.

4 years ago | 0

Answered
I have issue to resolve the equation using the For loop as MATLAB isn't providing this opportunity.
L = [0 100 200 200 200 30 300]; P = [0 1500 1700 1600 2000 1800 3000]; n = 5; twt = zeros(1, 5); for k = 1:5 twt(...

4 years ago | 0

| accepted

Answered
vecnorm seems slower than it should be
I can confirm your observation. A = rand(1e4, 1000) - 0.5; tic for k = 1:50 x1 = mean(abs(A),2); end toc; % Overhead ...

4 years ago | 1

| accepted

Answered
Alternative method to dec2bin function
Some simplifications: % Replace: flag = true; while flag == true % by while true If you have checked for: if bin(i) == ...

4 years ago | 0

| accepted

Answered
For loops in strings
energy = zeros(1, 50); for k = 1:50 [data, fs] = audioread(sprintf('Sound(%d).wav', k)); energy(k) = sum(data.^2); ...

4 years ago | 0

Answered
I keep receiving an error saying "execution of script drawpolygon as a function is not supported", even though it has previously worked.
The message means, that drawpolygon is a script. Then it does not have input nd output arguments: h = drawpolygon; % ^^^ om...

4 years ago | 0

Answered
How can I split measured data in separate vectors, depending on sign value?
Start with a simple loop approach: v = [1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1]; dv = [false, diff(v) > 0, false]; ini = strfi...

4 years ago | 0

Answered
csv file to matlab
Do you mean "import"? What about csvread or the modern readtable?

4 years ago | 0

| accepted

Answered
Group consecutive and non-consecutive values in a vector
nV1 = 8; V2 = [1,2,4,6,7]; grp = cumsum([true, diff(V2)~=1]); C = splitapply(@(x) {x}, V2, grp); if V2(end) == nV1 C...

4 years ago | 3

| accepted

Answered
how to get/obtain a specific column of a cell array
While this is trivial using the original numerical matrix, it is a mess using cells. This shows, that for your problem the decis...

4 years ago | 0

| accepted

Answered
how to add graph to output text file???
Text files cannot contain diagrams. So either export the diagrams and import them together with the text to e.g. Word. Or create...

4 years ago | 0

| accepted

Answered
How I download Matlab compiler toolbox free trial
MathWorks does not offer free trials of the compiler toolbox, as far as I know. You can get an official answer by asking the sal...

4 years ago | 0

Answered
Interpolate strings from an x y interval to a corresponding x y interval.
The solution is not to do this with strings directly, but with indices: idx = interp1(table1{:, 1}, 1:height(table1), table2{:,...

4 years ago | 0

| accepted

Answered
Need to plot points
scatter() is a "high-level" function for drawing. Such functions clear the contents of the axes automatically. To collect the ou...

4 years ago | 0

| accepted

Answered
i have a list of data and i have to select first 5th column of each row ..then simultaneously 6th column and 7th column
With some guessing: T = table(categorical({'karan';'varun';'ravina'}), ... [25;45;12],... {'Surgery';'orthopaedic';'o...

4 years ago | 0

Answered
Save data in cell using get function
I'm not sure, if I understand, what you are asking for. This part of the code looks strange: app.tables = cell(1, length(loadf...

4 years ago | 0

Answered
STL file from catia apparently empty?
As I thought, the file does not contain any data. The contents is really: solid CATIA STL endsolid CATIA STL Of course, this ...

4 years ago | 0

| accepted

Answered
Why do I get an infinity number in matrix X2?
X3 is growing massively until it reachs Inf. Simply insert some output, e.g. by removing the semicolon from "X2=X3;" to observe ...

4 years ago | 0

Answered
How can I manipulate with fields in structure.
A loop over the field names can achieve this: s = struct('field1',zeros(44,1),'field2',ones(44,1),'field3',randn(44,1)); % Tha...

4 years ago | 0

Answered
Cell2mat not working for high cell count
This means, that the arrays stored in the cell do not have matching sizes. Check this: sizeZ = [cellfun('size', z(:), 1), cellf...

4 years ago | 0

Answered
Finding erf using Maclaurin series breaks down around x = 5
Your code is almost correct and working, except for: factorial(n). When n is a double, this tends to overflow soon. So calculate...

4 years ago | 0

| accepted

Answered
how to save values in a matrix from a loop
A completely different approach: x = [2 2 2 3 3 5; 6 6 5 5 5 7]; nRow = size(x, 2); y = cell(1, nRow); % Pre-allocate:...

4 years ago | 1

Answered
Why am I getting an out of index error?
What is x1? The error message means, that it has 2 elements only, but you request x1(3). Your function handle takes the input x...

4 years ago | 0

Answered
high pass filter of IIR
What is n? %X = cos(20*pi*5*n*1/100) - sin(pi*2*n*1/100); %Y2 = 0.765*X - 1.53*(X-1) + 0.765*(X-2) + 1.475*(Y2 - 1) - 0.587*(Y...

4 years ago | 0

Answered
identify consecutive occurrence of 1 in a binary array
A = [0,0,0,0,1,1,0,0, ... % Using a row vector instead 1,0,1,1,1,1,0,0, ... 0,1,1,0,1,0,0,1]; % Find longest r...

4 years ago | 0

Load more