Answered
How to determine the index of two smallest probability in a vector
A=[0.7188 0.0625 0.0625 0.0469 0.0313 0.0156 0.0156 0.0156 0.0156 0.0156] index = find(ismember(A,min(A))) b = index(end-1:end...

7 years ago | 1

| accepted

Answered
I have a question on intapprox function and have no idea on how to do it. Can someone please help me?
https://www.mathworks.com/help/matlab/ref/integral.html

7 years ago | 0

Answered
Rename file when using copyfiile
https://www.mathworks.com/matlabcentral/answers/99856-how-do-i-rename-a-file-programmatically-in-matlab-7-10-r2010a#answer_10920...

7 years ago | 0

| accepted

Answered
if i have an array for example x=[1 2 3 4 5] now i want to assign an 1604 elements array into each one of five x elements
Cells are like containers they can can store as many x=cell(5,1); %create a cell x x{1}=v1; x{2}=v2; x{3}=v3; x{4}=v4; x{...

7 years ago | 0

Answered
Hi, I need some advice/help with cell accessing and operation in a for loop.
Since dist is a column vector use single index but you used double index which caused the problem : dist{n}=i{n,1}-i{n,2} %colu...

7 years ago | 0

Answered
Error: Unable to perform assignment because the left and right sides have a different number of elements.
The error was because V keeps increasing linearly by 5 so cell is needed to contain the values properly (since they have the cap...

7 years ago | 0

| accepted

Answered
Convert a vector of numbers in to time
Try datetime()

7 years ago | 0

| accepted

Answered
SOLVE ISNT GIVING ME MULTIPLE OUTPUTS
Loop is inefficient so use subs instead: syms Y P1 P2 P3 P4 s S = solve (Y==((0.02*s)+0.15),Y); P1 = solve (P1==((8...

7 years ago | 1

| accepted

Answered
How to label data of probability?
Don't think of doing it see https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dy...

7 years ago | 0

| accepted

Answered
Index in position 1 exceeds array bounds (must not exceed 3733)
It seems that your data has only 3733 rows but you are trying to access till 5500 rows which causes an error y = data(2900:siz...

7 years ago | 0

Answered
How I can insert label on each line in plot3
see label and legend xlabel('x') legend{'1'}

7 years ago | 0

| accepted

Answered
I try to install opencl-toolbox in matlab 2017a and i have a error and i don't now how to fix it. Someone who knows how to fix it???
It seems that you need to specify the path to your folder where you installed it

7 years ago | 0

Answered
Write vector to txt in a loop
This is efficient than writing in a loop: x=cell(1,a); for n=1:a x{n}=[1,n,3]; end x=[x{:}]; dlmwrite('abc_n_y.txt',x,'del...

7 years ago | 0

| accepted

Answered
error:An array for multiple LHS assignment cannot contain expressions.
The problem in your code was you put comma ( , ) instead of semicolon ( ; ) Reason see mldivide a1 = 15 ; a2 = 30 ; a3 = 20 ...

7 years ago | 0

Answered
Error: In an assignment A(:) = B, the number of elements in A and B must be the same.
u(ii+1)=(P_hat/K_hat).';

7 years ago | 0

| accepted

Answered
I have a 8 by 8 symbolic matrix and want to get its eigenvalues but unfortunately a very long answer more than 25000 characters, how can i get a short answer?
Try using vpa(result,2) if you use symbolic variables then its normal to expect such an output , try format short at the ve...

7 years ago | 0

Answered
Arduinoの入力補助でwriteDigitalPinや設定した変数が出てこない
https://www.mathworks.com/help/supportpkg/arduinoio/ref/writedigitalpin.html#buhprtc-2

7 years ago | 0

Answered
how to find the column number of a matrix?
[value,index]=max(A(1,:)) By default the second output of max will give you the index you require.

7 years ago | 0

| accepted

Answered
Undefined function 'substring' for input arguments of type 'char'. Error in extract_db (line 45) file_a = substring(char(file_a), 0, findstr(char(file_a), '_')-2);
AFAIK: There is no such syntax as substring() in matlab see https://www.mathworks.com/help/matlab/ref/extractafter.html ht...

7 years ago | 0

| accepted

Answered
How to write fft(x,n) without using fft function
https://www.mathworks.com/matlabcentral/answers/380099-how-to-modify-fft-equation-in-matlab#answer_303107

7 years ago | 0

Answered
How to calculate area of surface
https://www.mathworks.com/help/matlab/ref/alphashape.surfacearea.html https://www.mathworks.com/matlabcentral/answers/84614-fin...

7 years ago | 0

| accepted

Answered
I want to be able to count the correct number of wins and losses as it cannot do this currently, a wins when it gets to 20 and loses when it gets to 0, i am still learning this so i have am unsure as to the syntax to make this work
a=6;%a starting value b=14;%b starting value win=0; lose=0; Count=0; %counter for number of iterations involved in while loo...

7 years ago | 0

Answered
Draw 3D object.write code in 2016a version. Help me,thanks!
Read about fimplicit3() introduced in2016b requires symbolic math toolbox syms x y z fimplicit3(z==0) hold on fimplicit3(z==...

7 years ago | 0

Answered
How to plot binopdf? Do i need a download?
binopdf(X,3,.7) %you put x instead od X , matlab is case sensitive

7 years ago | 0

| accepted

Answered
Plotting two functions that depend on boundary conditions.
"I want to plot V_lamp_off when the value is between 1 and 4 and plot " Which value do you mean? Instead of if V_lamp_off <= ...

7 years ago | 0

| accepted

Answered
How do I calculate velocity with integration from acceleration data?
see https://www.mathworks.com/matlabcentral/answers/275484-integrate-acceleration-to-velocity-and-displacement#answer_215063 ve...

7 years ago | 0

Answered
Removing NAN values from the table and deleting it.
see https://www.mathworks.com/help/matlab/ref/rmmissing.html introduced in 2016b rmmissing(T) %deletes row containing nan where...

7 years ago | 6

| accepted

Answered
What is the difference between the disp function and fprintf?
https://www.mathworks.com/matlabcentral/answers/9701-sprintf-or-disp#answer_13329 https://youtu.be/4lVesnrYneA

7 years ago | 1

| accepted

Answered
Extracting info from multiple matrices
A=[1.02 0.2; 2.2 0.4; 0.5 0.6; 4.8 0.5; 1.5 0.3]; B=[58 63 27 1 478]; [value,idx]=max(A(:,2)) B(idx) %corresponding value in ...

7 years ago | 0

| accepted

Answered
Solving equations involving log
syms x r N U eqn=(r^x-1)/(r^N-1)==U; x=solve(eqn,x); pretty(x) %to display in a neat manner

7 years ago | 0

Load more