Community Profile

photo

per isakson


Last seen: Today

KTH

2,399 2010 年以降の合計貢献数

連絡する

per isakson's バッジ

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

すべて表示

貢献した分野
表示方法

回答済み
understanding "<" operator line
Consider the two lines midCirc = X.^2+Y.^2 < (1/n)^2; NmidCirc = not(midCirc); The first line assigns a logical value (true/f...

約12時間 前 | 0

回答済み
Searching for a matched string within nested cell and delivering the index
Assume there is ONE cell contaning 'TOTAL' Try %% ix = find( cellfun( @(cac) strcmp(cac{1},'TOTAL'), values ) ); num = value...

3日 前 | 0

| 採用済み

回答済み
Take average of multiple matrices
Try this %% load('data.mat') num = cat( 3, phi_BFD_v_sum{:} ); avg = mean( num, 3 ); peek >> avg avg = 0 ...

3日 前 | 1

回答済み
Pre-allocating cell containers
"I have pre-allocated memory". After pre-allocating memory for a variable you must not change its size. If you do, the effect o...

3日 前 | 0

回答済み
how to save the outputs obtained by a for loop repeated n times
tot is overwritten in each iteration of the for-loop Replace tot = (Tin{idx(:,i),i+1:i+3}); by tot(:,i) = (Tin{idx(:,i),i+...

6日 前 | 0

| 採用済み

回答済み
Kill a system process if it takes too long
I did this long time ago and have forgotten the details. And I haven't access to my code now. Thus from the top of my head. Ther...

9日 前 | 1

回答済み
Counting in one column that is conditional on another column
Does this do what you look for? %% limits = { [0;4], [4;5], [5;6], [6;7], [7;inf] }; %% some simple test data trials = {[ ...

9日 前 | 0

| 採用済み

回答済み
How to change data in a cell array of doubles?
??? "doing time = time - 1" doesn't "fix the time so that it starts from 0" Try this >> load('trials.mat') >> cac = cellf...

10日 前 | 1

| 採用済み

回答済み
Fprintf not inserting new line correctly with /n
The documentation of fprinf says fprintf(formatSpec,A1,...,An) applies the formatSpec to all elements of arrays A1,...An i...

11日 前 | 1

| 採用済み

回答済み
convert string to equation
Or a smelling solution if you don't have the symbolic toolbox >> x=3; >> v = eval('(5*x^2)') v = 45 >> Create an ano...

11日 前 | 0

回答済み
Find the value at exact location in a text file
An alternative construct based on ismembertol(). I believe it's faster. %% fid = fopen( 'cssm.txt', 'rt' ); % cssm.txt conta...

11日 前 | 0

回答済み
MATLAB not displaying answer correctly in command window
Look up the help on format specifier of fprintf(). Next replace the spec, %s, in your %%Display section by %+7.2f The tripl...

12日 前 | 0

| 採用済み

回答済み
Convert imported data from table to array
See table2array - Convert table to homogeneous array

12日 前 | 0

| 採用済み

回答済み
Help placing user input into an element in a row vector
Look up for in the documentation ... replace for i = 1 < score by for i = 1 : data

13日 前 | 0

回答済み
Putting three separate arrays into one new array
Try NewArray = [array1, array2, array3]; or NewArray = horzcat(array1, array2, array3); instead

15日 前 | 1

| 採用済み

回答済み
2 columns put together
One way >> c = [x,y]; % concatenate x and y horisontally >> c(2,:) % second row ans = 0.585 0.4926 >>...

16日 前 | 0

回答済み
How to extract certain values from an array
First see Array Indexing and Find Array Elements That Meet a Condition. Then try >> x=[8,5,5,5,9,4,3,2,9,10]; >> new = x(x<7) ...

16日 前 | 0

| 採用済み

回答済み
How can I change an element in a matrix with the median of itself and its surrounding elements.
"but I do not know how to specify the median function to take the localized 3x3 matrix of a larger array" Combine these two e...

約1ヶ月 前 | 0

回答済み
How do you import specific rows of numeric data (without text) for the file I have attached?
Maybe not the most rubust way, but it does the job. (The numerical blocks must be followed by non-numerical text.) %% ffs = '1...

約1ヶ月 前 | 0

| 採用済み

回答済み
How to Speedup conditional vector elements replacement?
There is a Matlab function, repelem, that does it. >> repelem( b, a ) ans = Columns 1 through 13 1 6 6 6 ...

約1ヶ月 前 | 0

| 採用済み

回答済み
Create all combination of strings
See: perms, All possible permutations In response to comment Does the function, cssm(), do what you ask for? >> all_permuta...

約1ヶ月 前 | 0

質問


How to edit and replace comments on File Exchange submissions?
It's a hidden algorithm that controls what happens when I write comments on my submissions at File Exchange. I failed to find a ...

約1ヶ月 前 | 0 件の回答 | 0

0

回答

回答済み
Speed up code:: Code is working but slow..
See: Profile Your Code to Improve Performance and Techniques to Improve Performance

約2ヶ月 前 | 0

回答済み
How do I use numerical and logical indices to get this output?
One out of many ways %% myArray = [2, 4, -3, 6, 9]; isneg = myArray < 0; myArray( isneg ) = 1;

約2ヶ月 前 | 1

回答済み
Change [ ] cells in .mat file to NaN
I don't fully understand your question. See: TUTORIAL: how to ask a question (on Answers) and get a fast answer "The code bel...

約2ヶ月 前 | 0

回答済み
How do I append a row average to a new matrix
With a little bit of guessing. Does this answer your question? %% foo = randi(500,500); cac = mat2cell( foo, 5*ones(100,1), 5...

約2ヶ月 前 | 1

| 採用済み

回答済み
Preventing too many function inputs
>> exfunction(1,3,9,4,5) throws the error Error using exfunction Too many input arguments. I assume that's the error you e...

約2ヶ月 前 | 0

回答済み
MATLAB Answers Wish-list #5 (and bug reports)
Activity Feed: "See more" asks for "See less".

約2ヶ月 前 | 1

回答済み
How to modify few numbers in a random text file?
Try this %% chr = fileread('model_v2.txt'); ffs = 'model_out.txt'; fid = fopen( ffs, 'w' ); [~] = fprintf( fid, chr, 1.2, 3...

2ヶ月 前 | 0

回答済み
How to replace elements of a cell array using a containers.Map
With string and arrayfun on R2018b %% names_to_replace = ["TonnageDeBSA", "D__bitD___eauAuBSA", ... "Pres...

2ヶ月 前 | 0

Load more