Answered
Setting a set of values in a loop
Write this function and save it as function_name.m function c=function_name(a,b) for k = 1:3 c(k)= a(k) + b (k); end ...

9 years ago | 0

Answered
How to I lock what date 'today' is?
save your parameter in a mat file a = datetime('today'); save file a

9 years ago | 0

Answered
i have an 6*6 matrices how can i get an characteristic equation my A matriix is
A=[0 1 0 0 0 0;693.148 0 0 0 -13.8755 0;0 0 0 1 0 0;0 0 318.9488 0 0 0;0 0 0 0 0 1;-4.318*10^5 0 0 0 -731.89 0] syms lamda I...

9 years ago | 0

Answered
How to find floor value of a cell??? please help....
your_cell_array={1.23 2.58 3 7.02 -4.6 -4.2} your_cell_array=cellfun(@floor,your_cell_array,'un',0)

9 years ago | 0

Answered
Using csvwrite() function for a matrix having multiple rows and columns??
A=randi(10,100,30) csvwrite('file.csv',A)

9 years ago | 0

Answered
how to get the diffrent Variables used on model to a m file
You can use a to workspace block or a to file block

9 years ago | 0

| accepted

Answered
Semi-transpose a matrix
a = [1 2 3 4 5 6 0 3 2 1 2 3 0 0 0 1 1 1 8 9 9 1 2 3] b=a' b=b(:)' Or b=reshape(a',1,[])

9 years ago | 0

Answered
How to delete specific lines in a table
Look at this example B = {1, '' , '14b', '(' , 2, 9, '}', ''}' A=num2cell(ones(size(B))) C=cell2table([A B],'variablename...

9 years ago | 0

Answered
Convert column into cells
final(:,5)=cellfun(@times,final(:,3),final(:,4),'Uni',0); final(:,5)=cellfun(@(x) x/100,final(:,5),'un',0)

9 years ago | 0

| accepted

Answered
tick rotation in old version of matlab
Look at file exchange : <https://www.mathworks.com/matlabcentral/fileexchange/3486-xticklabel-rotate>

9 years ago | 1

| accepted

Answered
Two different scales on same axis
x=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,416,816,1216,1616,2016,2416,2816,3216,3616,4016,4416,4816,5216,5616,6016] y=sin(x) ...

9 years ago | 0

| accepted

Answered
Single use Simulink Switch
<</matlabcentral/answers/uploaded_files/55896/ans2.jpg>>

9 years ago | 4

| accepted

Answered
How to open figure with out matlab
To save your figure as jpg file, Add this saveas(gcf,'figure1.jpg')

9 years ago | 1

Answered
change the data location
reshape(A,3,3)

9 years ago | 0

| accepted

Answered
read data from files in a loop and append into one array
filenum = 2; M=[]; for ii=1:filenum name=sprintf('output%d_%dstd.txt',ii,stdtimes) M=[M;dlmread(name)] %here...

9 years ago | 0

| accepted

Answered
Error with division of a matrix by a vector
a=randi(10,1,10) b=randi(10,10,12) bsxfun(@rdivide,a',b)

9 years ago | 0

| accepted

Answered
How to extract 40 points from each slice in binary image ?
You didn't specify what 40 points? A=rand(10,10,10)>0.5 % Example n=size(A,3) out=arrayfun(@(x) A(1:4,1:10,x),1:n,'un',...

9 years ago | 1

Answered
How can I Plot a graph in real time
Look at this example figure hold on for k=1:100 y(k)=sin(k) pause(1) plot(y) end

9 years ago | 0

Answered
How to use fprintf in the following situation?
M=[ 12 0 12 11 0 11 10 6 4 12 0 12 ...

9 years ago | 1

| accepted

Answered
How do I print only one element of a char array with same elements?
x=1:20; [test1,test2,test3,test4]=deal(0) for i=1:20 if x(i)<=5 & test1==0 say=('Hi') test1=1; e...

9 years ago | 1

Answered
Jacobi method not working
What is this: |for j = 1:i-1,i+1:n| ? Maybe you mean |for j = [1:i-1,i+1:n]|

9 years ago | 0

Answered
Average of consecutively increasing numbers
years = [1950,1950,1950,1950,1951,1951,1958,1958,1958,1959]' month= [11,11,11,11,3,3,2,2,2,3]' day= [22,23,24,25,11,12,15,16...

9 years ago | 1

| accepted

Answered
math function for a vector
function sig = sigmoid( x) sig = 1./(1+exp(-x));

9 years ago | 0

| accepted

Answered
Error while using cell2mat:
That means the sizes of your cells do not allow to concatenate them

9 years ago | 0

| accepted

Answered
Index of the row
[~,idx]=min(abs(your_vector-threshold))

9 years ago | 1

Answered
Replacing repeated elements with the index of the first element
load nneigh out=nneigh; [ii,jj,kk]=unique(nneigh,'stable'); b=accumarray(kk,(1:numel(kk))',[],@(x) x(1)); for k=1:numel(ii...

9 years ago | 0

Answered
Taking a certain column from each cell with different size
a{1} = [1 2 3] a{2} = [1 2 3; 4 5 6; 6 7 8] a{3} = [1 2 3; 4 5 6; 7 8 9; 2 5 8; 4 5 6] b=cell2mat(a') out=b(:,2) %Or ...

9 years ago | 1

| accepted

Answered
How do you append to a matrix within a for loop?
A=[1 2;3 4] B=[4 5;6 7] A=[A;B]

9 years ago | 0

Load more