Answered
How to increase the speed of this code?
i = 0.01:0.01:0.1 j = 0.01:0.01:.1 k = 0.01:0.01:.1 [ii,jj,kk]=meshgrid(i,j,k) out=[kk(:) ii(:) jj(:)]

10 years ago | 0

Answered
Editing a txt file and replace a specifics lines
Read your text file fid=fopen('ZZZ.txt') s=textscan(fid,'%s') fclose(fid) out=[s{:}] Then replace whatever you want

10 years ago | 0

| accepted

Answered
Finding roots of symbolic polynomial on given interval
syms x g = 2097152*x^11 - 11534336*x^10 + 27394048*x^9 - 36765696*x^8 + 30638080*x^7 - 16400384*x^6 + 5637632*x^5 - 1208064*x...

10 years ago | 0

| accepted

Answered
Hi, please if I have 500 I want to do like this for all the images I need a " for "but I don't how, thank you for help
for k=0:500 a=imread(sprintf('image\%d.jpg',k)); r=a(:,:,1); v=a(:,:,2); b=a(:,:,3); couleur=(r+v...

10 years ago | 0

| accepted

Answered
I have data in multiple excel sheets. How do I import only certain columns only and plot the data.
range='B:C' % column B and C xlsread('file.xlsx',range)

10 years ago | 0

| accepted

Answered
matrix sum with extending dimensions
a=[1,0;0,1] b=[2,0;0,2] ad=diag(a), bd=diag(b), dc=[ad(1:end-1) ;ad(end)+bd(1) ; bd(2:end)] c=diag(dc)

10 years ago | 0

| accepted

Answered
How to use num2cell?
c=num2cell(cell2mat(production(:,3)))

10 years ago | 0

| accepted

Answered
How do I run a script for simulink?
Probably you gave the same name to your slx model and your m-file. Rename one of the two files

10 years ago | 0

| accepted

Answered
Remove all remaining charaters once the first non digit occurs within a vector of an array and keep everything before the non digit
a={'2270|1|60';'223570|1|60'} out=regexp(a,'\d+(?=|)','match','once')

10 years ago | 0

Answered
How to generate a random matrix with conditions?
It's almost what you are asking for! A = [ 2 3 1 3 1 1 4 1 0 2 2 0 ] [n,m]=size(A); ii=max(sum(A,2)); no=...

10 years ago | 0

Answered
How to generate a random matrix with conditions?
I think this is What you want: A = [ 2 3 1 3 1 1 4 1 0 2 2 0 ] [n,m]=size(A); ii=max(sum(A,2)); no=ii+m-1;...

10 years ago | 0

Answered
Hi PLEASE read the following question
<http://www.mathworks.com/help/matlab/ref/function.html>

10 years ago | 0

Answered
Regarding textscan error - Values must be increasing and non-NaN
fid=fopen('A.txt') b= textscan(fid,'%f %f'); fclose(fid) out=cell2mat(b)

10 years ago | 0

| accepted

Answered
Saving while loop data from the sum of a randomize array of 10 numbers For M amount of trials
M= input('enter maximum number of trials : '); n= input('designate your n value: '); P=.5; t=0; k=0; while t<M; k=k+...

10 years ago | 0

Answered
Removing all zeros in rows
Maybe you want this A=[5 0 0 0 0 4 0 0 0 0 3 0 0 0 0 0 0 0 0 2 0 0 0 1 0 7 0 0 3 0 0 0 1 0 0 0 0 0 0 3] c1=nonzer...

10 years ago | 0

Answered
How to take values from a .txt file and show them as a vector?
You have an example in Matlab help <http://www.mathworks.com/help/matlab/ref/fgetl.html>

10 years ago | 0

Answered
Binary string to character string
char(bin2dec(Msg))'

10 years ago | 0

| accepted

Answered
Storing data from a for loop in a matrix
Cl_initial=3; R=0.5; u=0.5; Clt=[]; % Solve for Cl residual. for t=[68.92 109.97 287.22 116.95 171.89 90.3 103.54] C...

10 years ago | 2

Answered
How can I save the values of multiple plots in order to be exported to excel?
Use xlswrite function: <http://www.mathworks.com/help/matlab/ref/xlswrite.html>

10 years ago | 0

Answered
complex fourier series in matlab
<http://www.mathworks.com/help/matlab/ref/fft.html> <http://www.mathworks.com/help/matlab/ref/fft.html#buuutyt-6>

10 years ago | 0

| accepted

Answered
find the index of the rows that have all 1
idx=find(all(A,2))

10 years ago | 0

| accepted

Answered
Divide group into subgroups
group=[2 1 2 3 5] the variable group indicate what you want

10 years ago | 0

| accepted

Answered
swiching elements of same vector
X=[ 20; 0; 0;0; 100; 0;0;0;50] ii=find(X~=0)' idx=circshift(ii,[0 1]) X(ii(2:end))=X(idx(2:end)) X(ii(1))=0

10 years ago | 0

| accepted

Answered
How to convert a .mat file into a .csv file?
FileData = load('Trainset.mat'); v=reshape([FileData.M],size(FileData)) csvwrite('FileName.csv', v)

10 years ago | 0

Answered
I need to draw a curve on a plot such that it has 2 different functions
x1=0:0.001:0.06 y1=0.1-(0.0036-(x-0.06).^2).^(1/2) x2=0.06+0.001:1 y2=0.04*ones(size(x2)) plot([x1 x2],[y1 y2])

10 years ago | 0

Answered
Hi, I have an excel file with 3 columns (date, direction and speed) and 200000 rows for 20 years. How can I create different excel sheet for different year using matlab.
Look at this example v=[197301011500 10 23 197301011800 360 30 197301011900 350 29 197301012000 350 28 197301012100 350...

10 years ago | 1

Answered
Mean of a 3D cell
[n,m,p]=size(voltage); v=cell2mat(voltage); w=permute(v,[2 1 3]); [ii,jj,kk]=size(v); for k=1:p f(:,:,k)=mean(reshape...

10 years ago | 0

Answered
Index into a table using a vector of values
A=[5 1;7 3;12 4;47 4;6 4] out=A(ismember(A(:,2),[1 3 4]),:)

10 years ago | 1

| accepted

Load more