Answered
How to successively fill a matrix using a for loop?
% -------Example------- M=cell(4,16); M=cellfun(@(x) rand(256,1800),M,'un',0) %------------The code------------ A=M(1,:)...

9 years ago | 0

Answered
Solve Equation numerically for variable
solve('A + B*cos(w) + C*cos(w)')

9 years ago | 0

Answered
Finding specific row and column of different matrices.
D=cat(3,A,B,C) sort(D(1,2,:))

9 years ago | 0

Answered
How to get 3D matrix when using int2string for two variables
You don't need to use Eval function: W1T1=rand(4) W1T2=rand(4) W2T1=rand(4) W2T2=rand(4) s=whos('-regexp' ,'^W\dT\d$') ...

9 years ago | 0

| accepted

Answered
How to index a for loop with negative subscript indices?
You can't use negative indices in Matlab, but this is not a problem. Look at this example k=0 for l = -P:P k=k+1 ...

9 years ago | 0

| accepted

Answered
How to find the distance between one slope and several points?
x0=A(2:4,1) y0=A(2:4,2) d=(abs(((x2-x1).*(y1-y0))-((x1-x0).*(y2-y1)))./(sqrt((x2-x1)^2+(y2-y1)^2)));

9 years ago | 1

| accepted

Answered
How to create a vector dVec = [5^0 5^0.01 ⋯ 5^0.99 5^1].
ldVec = logspace(0, log10(5), 100)

9 years ago | 0

Answered
xlsread reading in erroneous values.
Maybe you need to specify the path path='C:\Users\malek\Google Drive\matlab' name=fullfile(path,'filename.xls') data = xl...

9 years ago | 0

Answered
Why NaN inf appears when only use simple sum and multiply
nan is caused by 0/0 and inf is caused by 1/0 for example

9 years ago | 0

Answered
What does ;= mean?
there is no ;= operator in Matlab,you can get all Matlab operators here <http://www.mathworks.com/help/matlab/operators-and-elem...

9 years ago | 0

Answered
How to ranking the values of one column in matrix and replace it without sorting of values of next column?
A =[ 4 7 2 2 10 2 6 1] B=sortrows(A)

9 years ago | 1

| accepted

Answered
Help reading text file in original format
fid=fopen('file.txt') str=fgetl(fid); out=[]; while ischar(str) out{end+1,1}=str; str=fgetl(fid); end fclose(fid)...

9 years ago | 0

| accepted

Answered
Using load command with regexp
load('matFile','-regexp','M[a-z]{2}$')

9 years ago | 0

Answered
select specific sheet in csv file
Using xlsread you can select any sheet

9 years ago | 0

| accepted

Answered
How to create letters, numbers and special characters
out=arrayfun(@(x) sprintf('{f(A,%d)}',x),(0:8)','un',0) Or out=sprintf('{f(A,%d)}\n',(0:8)')

9 years ago | 1

| accepted

Answered
Puzzler: Count unique nonzero periods in a timeseries without a for loop
a=[0,1,0,0,0,.3,1,0,0,1] out=numel(strfind([0 logical(a)],[0 1]))

9 years ago | 0

| accepted

Answered
Any ideas how i can reduce the execution time?
newdes=[0.6250 0.8750; 0.2500 0.7500; 0.3750 0.1250; 0.8750 0.3750; 0.1250 0.6250; 0 0; 0.5000 0.5000; 0.7500 0.2500; ...

9 years ago | 0

Answered
cannot setup MEX with R2014b Visual Studio 2015 Windows 10
<http://www.mathworks.com/support/sysreq/files/SystemRequirements-Release2014b_SupportedCompilers.pdf>

9 years ago | 0

Answered
Using contour as input for a function
You can use the handle of your plot. Example function y=your_function(h) y=get(h) To call the function handle_...

9 years ago | 0

Answered
concatenate matrices into one
M=[] for ii=1:15 for jj=1:12 name=sprintf('B%dC%d',ii,jj) s=load(name) n=fieldnames(s) ...

9 years ago | 0

Answered
How can I save my output of the regression loop in matrix?
I can't test your code, but it seems that you added a condition if size(y,1)~= size(x,1), then maybe your code should be like th...

9 years ago | 0

Answered
Want to convert hourly Data into Daily Mean
%--------------Example---------------------------------- d=datenum('28-03-2013 07:00:00','dd-mm-yyyy HH:MM:SS'):1/24:datenum(...

9 years ago | 0

| accepted

Answered
Extract number on variable name.
s='Final_50000_run_1' regexp(s,'\d+','match','once') If you want to extract all the numbers regexp(s,'\d+','match')

9 years ago | 1

Answered
What algorithm is matlab using to create randn numbers
<https://www.mathworks.com/matlabcentral/answers/97811-what-is-the-algorithm-used-by-the-normally-distributed-pseudorandom-numbe...

9 years ago | 0

| accepted

Answered
Quantiles of a matrix
quantile(quantile(x,p),p) %or maybe quantile(x(:),p)

9 years ago | 1

| accepted

Answered
Calculate value based on previous row plus adjacent row
idx=1:6 out=B(idx)+A(idx+1)

9 years ago | 0

Answered
what is the maximum dimension size we can generate by rand function?
Type memory you will get Maximum possible array a=rand whos a Name Size Bytes Class At...

9 years ago | 0

Answered
How to remove repeating pair
A={'A' 'B' 1 'N' 'M' 1 'Y' 'L' 1 'B' 'A' 1 'K' 'U' 1 'L' 'Y' 1 'A' 'B' 1 'U' 'K' 1 'P' 'G' 1 'M' 'N' 1 'X' 'Z' 1...

9 years ago | 0

Load more