Answered
Concatenate series of images from different folders
You should replace oriPath = [oriDir oriList(1).name] convPath = [convDir convList(1).name]; by oriPath=fullfil...

9 years ago | 0

Answered
If matlab simulink model can work with integer data type
<http://www.mathworks.com/help/simulink/ug/control-signal-data-types.html>

9 years ago | 0

Answered
can anyone help me for loop
w=linspace(some_value1,some_value2,360) H=sind(w+1)-sind(w)

9 years ago | 0

Answered
how to concatenate structure fields
Look at this example s(1).f(1).d=11 s(1).f(2).d=12 s(2).f(1).d=21 s(2).f(2).d=22 a=s.f n=numel(a) for k=1:numel(s) ...

9 years ago | 1

| accepted

Answered
how to divide each row of a cell by maximum number
M=[2, 3, 10, 65 1, 5, 4, 2 8, 3, 1, 9] out=bsxfun(@rdivide,M,max(M,[],2))

9 years ago | 1

Answered
how to read list of files in correct sequence.
Your names look like this s=arrayfun(@num2str,1:100,'un',0) a=sort(s) To sort them as you want [~,ii]=sort(str2dou...

9 years ago | 0

Answered
how to write cos*cos*sin
f=@(x) cos(x)*cos(x)*sin(x)

9 years ago | 0

Answered
getting a specific paragraph from a .txt file
You can use regexp

9 years ago | 0

Answered
Saving a 1x2 structure with 5 fields
First, avoid using sum as a variable because it's a built-in Matlab function som.a=4 som.b=5 save ('mysum.mat', '-struct'...

9 years ago | 0

Answered
Concatenate along singleton dimension?
A=rand(5,1) B=rand(1,4) out=[A(:);B(:)]

9 years ago | 0

| accepted

Answered
How to add rows into existing .mat file?
Look at this example, you can save your matrix as matrices of 100000 rows each for example str='a':'z' for k=1:10 cle...

9 years ago | 1

Answered
Generating random numbers from 0 - 1 with limit on the sum
a1=2 a2=3 a3=4 D=5 v=rand(1,2) x1=v(1) x2=v(2) x3=rand*(D-a1*x1-a2*x2)/a3 Check x1*a1 + x2*a2 + x3*a3<D

9 years ago | 0

Answered
Create an array that has ones
A=arrayfun(@(x) circshift([zeros(1,41);ones(255,41)],[x 1]),1:255,'un',0)

9 years ago | 0

| accepted

Answered
get problem with while loop
Rx is an undefined variable, you need to put R1,R2,...,R5 in a vector %%% Thermal resistance R1=0.0016; R2=0.0018; R3=0....

9 years ago | 0

Answered
pulling a value from a column matrix
Look at this example a=[0 0 0 1 0 0 2 0 0 3 0 0 0 4 5] b=[6 7 8 9 10] a(6)=b(3) %The last line will display all the v...

9 years ago | 0

Answered
transfer function command to use in 'Matlab function block'
The function tf is not allowed for code generation, I suppose the function c2d is also not allowed, then you need to find anothe...

9 years ago | 0

| accepted

Answered
Store "From Workspace" Variable into array in Simulink
Use matlab function block with this code function y = fcn(u) %#codegen persistent k z n=10 if isempty(k) k=0 ...

9 years ago | 0

| accepted

Answered
How to only keep lines that start with a number?
If filename.tx is your text file fid=fopen('filename.txt') l=fgetl(fid); s={}; while ischar(l) s{end+1,1}=l; ...

9 years ago | 0

Answered
Sum the daily data based on month and year
%Example date=datenum('2021/01/01'):datenum('2051/12/31'); date=datevec(date); M=[date(:,1:3) randi(10,size(date,1),1)] ; ...

9 years ago | 2

| accepted

Answered
At every nth line read n lines together
You can't do it without a for loop unless you read all the file, then select the lines you want

9 years ago | 0

Answered
import data from csv file
you can use csvread or xlsread [ii,jj,kk]=xlsread('btl-file.csv')

9 years ago | 0

Answered
Remove duplicate cells from cell array of different dimensions
A=arrayfun(@(x) randi(10,1,randi([3 8])),1:900,'un',0); % Example b=cellfun(@(x) sort([x nan(1,8-numel(x))]),A,'un',0) c=cel...

9 years ago | 0

Answered
Find string ends with xls or xlsx
str='abc.xlsx xls.m df.xls er.doc sd.xls' out=regexp(str,'\S+\.xlsx?\>','match')

9 years ago | 1

| accepted

Answered
Put a number from a header into a variable?
s='Lead Number 1 Time Step .001 Data Points 6001 ' ts=str2double(regexpi(s,'Step\s*(\d?\.?\d+)','tokens','once'))

9 years ago | 0

Answered
sum of two cell arrays with different dimensions
A={rand(4,1) rand(4,1)} % Example B={{rand(4,1) rand(4,1)},{rand(4,1) rand(4,1)},{rand(4,1) rand(4,1)}} C=cellfun(@(x) cellf...

9 years ago | 1

| accepted

Answered
How FFT works in a signal?
That's what FFT do <https://en.wikipedia.org/wiki/Fast_Fourier_transform>

9 years ago | 0

Answered
sum of doubles of different cells
C=cellfun(@(x,y) x+y,A,B,'un',0)

9 years ago | 2

Answered
Add 0 at end of double
S={'25521' '45674' '45618' '29466' '3346' '36024' '5082' '47221' '42987'} S=cellfun(@(x) str2num([x repmat('0',1,5-numel(x))]...

9 years ago | 0

Load more