Community Profile

photo

per isakson


KTH

Last seen: Today 2010 이후 활성

Statistics

All
  • Revival Level 3
  • Ace
  • Leader
  • Speed Demon
  • Personal Best Downloads Level 2
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 4
  • First Submission
  • 36 Month Streak
  • Thankful Level 3
  • Knowledgeable Level 4

배지보기

Content Feed

보기 기준

답변 있음
Gang-of-Four Design Patterns in MATLAB
I'm not aware of any "full or partial MATLAB collection" and I've search for it more than once. Googling for "design patterns ...

7일 전 | 1

답변 있음
How to relocate (left side) the legend in plot ?
Read the documentation on legend() and notice legend(___,'Location',lcn)

8일 전 | 0

| 수락됨

답변 있음
Creating charts in Matlab
Yes, see the function, bar( ..., 'stacked' ). However, it lacks the 3D character of the bars.

8일 전 | 1

| 수락됨

답변 있음
MATLAB Answers Wish-list #5 (and bug reports)
Background: I recently put some effort into answering How to store and reuse coefficients in a for loop. My answer together wi...

10일 전 | 1

답변 있음
How to store and reuse coefficients in a for loop
Caveat: I don't fully understand your code and what I say might not be relevant to your real project. "% Can this double for lo...

11일 전 | 1

| 수락됨

답변 있음
check ismember for each element individually
The function arrayfun() does the trick (i.e. hides the foor-loop) a=[ 1 2 3 3 5 6 6]; b=[1 2 3 5 6]; cac = arrayfun( @(ii) fi...

11일 전 | 0

답변 있음
Is it possible to put multiple functions in one matlab file file?
"I currently have six seperate scripts [you mean functions?]" What differs between the six functions? The name of the nc-files ...

약 1달 전 | 0

답변 있음
When constructing an instance of class, the constructor must preserve the class of the returned object.
I don't know C++. (For some reason you added the tag "C++".) I guess you are biased by some other language. You need to look cl...

약 1달 전 | 0

답변 있음
How do I make this a function?
Something like this. With Matlab it's common practise to use double for all numerical variables. (Matlab has "integer in floatin...

약 2달 전 | 0

| 수락됨

답변 있음
Create table from structure - alignment
I've modified the format specifier. %% mom.a = 1; mom.b = 2; mom.veryLongName = 3; header = {'Moment'; 'Value'}; fnames = ...

2달 전 | 0

답변 있음
How to replace a number in a row vector with NaN in certain condition
abs(x(6)-x(8)) is equal to 10. Accourding to x_new, x(8) should be replaced by NaN. Thus I have use ">=". %% vec = [15 13 9 ...

2달 전 | 1

| 수락됨

답변 있음
Getting Windows to open a file type using a MATLAB application
An alternative that doesn't require the Matlab compiler (but requires a Matlab license to run): Create a bat-file, e.g. read_xl...

2달 전 | 0

답변 있음
How can I read a '.dat' file on MATLAB?
google says: "A file with the . dat file extension is a generic data file that stores specific information relating to the progr...

2달 전 | 0

답변 있음
How to quickly find the indecies of elements in an array?
A = [1 9 2 8 3 7 4 6 5]; B = [5 6 7]; [~,ix] = ismember( B, A )

2달 전 | 0

| 수락됨

답변 있음
creating a character array in which each element takes multiple characters put together
The RHS of the two assignments in the for-loop are they correct? Don't show data as images. Seven lines can be included as cod...

2달 전 | 2

답변 있음
Why is command window printing out all the code?
There is a function called echo(), which I've never used. Have you run echo on by mistake? I reproduced the behavior you see ...

2달 전 | 0

답변 있음
Extracting data using regular expression
"all the columns [...] named "Physics", "Time", "dt", "Progress", "Nonlinear Iteration" "Linear Iterations"...."Nodes After Adap...

2달 전 | 1

| 수락됨

답변 있음
Load .dat files from subfolders with different names
Yes to both questions. With help of the code snippets below I guess you can put together a script. sad = dir( fullfile('Folder...

2달 전 | 0

답변 있음
Index exceeds the number of array elements (1).
Here are some links on debugging in Matlab Debug a MATLAB Program Debugging in MATLAB Debugging session Debugging Approaches...

3달 전 | 0

답변 있음
Specific values in an Array
R=[]; for i=1:1:5 for y=5:1:10 eq1=i*y; %% To save the values: R=[R; i y eq1]; end end a...

3달 전 | 1

답변 있음
Auto fetch input files to process from a specified folder
"I have a lot of data files that I would like to process through my code [...] each file from a specified folder one at a time" ...

3달 전 | 0

| 수락됨

답변 있음
Plotting a limited number of elements
"plot the first 5" An if-statement should do that. Replace plot(jvals(i,:), vetor_momentoj(i,:), '-o'), hold all by if i <= ...

3달 전 | 1

| 수락됨

답변 있음
How to modify a function handle?
That's simpler than you thought %% f1 = @(y) y; f2 = @(y) f1(y)*2; %% f2(5)

3달 전 | 0

| 수락됨

답변 있음
Storing variables in a for loop within another
"store the variable "vetor_momentoj" [...] in terms of the indexes i and j." Something like this? I replaced the calculation of...

3달 전 | 0

| 수락됨

답변 있음
Calculate with initial value
There is nothing that terminates the execution of the loop when convergence is reached. Thus, the while-loop will run until the ...

3달 전 | 1

| 수락됨

답변 있음
How to save data from a file with text and numbers?
"load this file and save lines starting from 'Step' to 'ID Type' to another file" Including the "ID Type" block - or not ? Thi...

3달 전 | 0

| 수락됨

답변 있음
what's wrong with this "IF" in the code below?
Cannot tell based on the info of your question. Show full error message. Set Pause on Errors Run the code. Execution will h...

3달 전 | 1

답변 있음
how to delete data with special value in an array?
"to delete the value" Do you mean remove? If so, try this script which uses logical indexing %% vec = 1+2*randn( 1, 800 ); %...

3달 전 | 0

| 수락됨

답변 있음
conversion of date from yyyymmddHHMMSS format to yymmddHHMMSS format.
vec = datevec( '2020,07,23,00,00,00', 'yyyy,mm,dd,HH,MM,SS' ); datestr( vec, 'yymmddHHMMSS' ) or did you mean datestr( vec, '...

3달 전 | 0

답변 있음
I am getting "Too few input arguments." error. How can i solve it?
See Not enough input arguments. And see narginchk - Validate number of input arguments.

3달 전 | 0

더로드