C = cell(3)
C = 3×3 cell array [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] |
C = cell(3,4,2); size(C) ans = 3 4 2 |
A = [7 9; 2 1; 8 3]; sz = size(A); C = cell(sz) C = 3×2 cell array [ ] [ ] [ ] [ ] [ ] [ ] |
A(1,1) = {[1 4 3; 0 5 8; 7 2 9]}; A(1,2) = {'Anne Smith'}; A(2,1) = {3+7i}; A(2,2) = {-pi:pi/10:pi}; |
B{1,1} = [1 4 3; 0 5 8; 7 2 9]; B{1,2} = 'Anne Smith'; B{2,1} = 3+7i; B{2,2} = -pi:pi/10:pi; |
x = { [2 1 3;4 5 2] 2 [3 4 3]';... 'first' 'second' 'third';... ones(1,50) zeros(25) 'hidden' } |
x{3,3} class(x{3,3}) x{3,3}(3) x(3,3) class(x(3,3)) x{3,2}(2,5) = 25 x{3,2} |
A = cell2mat(C) |
C = {[1], [2 3 4]; [5; 9], [6 7 8; 10 11 12]} m = cell2mat(c) m = 1 2 3 4 5 6 7 8 9 10 11 12 |
structArray = cell2struct(cellArray, fields, dim) |
5 Years | 10 Years | 15 Years | |
---|---|---|---|
Development | Lee, Reed, Hill | Dean, Frye | Lane, Fox, King |
Sales | Howe, Burns | Kirby, Ford | Hall |
Management | Price | Clark, Shea | Sims |
Quality | Bates, Gray | Nash | Kay, Chase |
Documentation | Lloyd, Young | Ryan, Hart, Roy | Marsh |
devel = {{'Lee','Reed','Hill'}, {'Dean','Frye'}, {'Lane','Fox','King'}}; sales = {{'Howe','Burns'}, {'Kirby','Ford'}, {'Hall'}}; mgmt = {{'Price'}, {'Clark','Shea'}, {'Sims'}}; qual = {{'Bates','Gray'}, {'Nash'}, {'Kay','Chase'}}; docu = {{'Lloyd','Young'}, {'Ryan','Hart','Roy'}, {'Marsh'}}; employees = [devel; sales; mgmt; qual; docu] |
rowHeadings = {'development', 'sales', 'management', 'quality', 'documentation'}; depts = cell2struct(employees, rowHeadings, 1) |
colHeadings = {'fiveYears' 'tenYears' 'fifteenYears'}; years = cell2struct(employees, colHeadings, 2) |
rowHeadings = {'development', 'documentation'}; depts = cell2struct(employees([1,5],:), rowHeadings, 1) |
for k=1:3 depts(k,:) end ans = development: {'Lee' 'Reed' 'Hill'} documentation: {'Lloyd' 'Young'} ans = development: {'Dean' 'Frye'} documentation: {'Ryan' 'Hart' 'Roy'} ans = development: {'Lane' 'Fox' 'King'} documentation: {'Marsh'} |
c = struct2cell(s) |
s.category = 'tree'; s.height = 37.4; s.name = 'birch'; s = category: 'tree' height: 37.4000 name: 'birch' c = struct2cell(s) c = 'tree' [37.4000] 'birch' |
patient(1).name = 'John Doe'; patient(1).billing = 127.00; patient(1).test = [79, 75, 73; 180, 178, 177.5; 220, 210, 205]; patient(2).name = 'Ann Lane'; patient(2).billing = 28.50; patient(2).test = [68, 70, 68; 118, 118, 119; 172, 170, 169]; numPatients = numel(patient); for p = 1:numPatients figure bar(patient(p).test) title(patient(p).name) end |
temperature(1,:) = {'01-Jan-2010', [45, 49, 0]}; temperature(2,:) = {'03-Apr-2010', [54, 68, 21]}; temperature(3,:) = {'20-Jun-2010', [72, 85, 53]}; temperature(4,:) = {'15-Sep-2010', [63, 81, 56]}; temperature(5,:) = {'31-Dec-2010', [38, 54, 18]}; allTemps = cell2mat(temperature(:,2)); dates = datenum(temperature(:,1), 'dd-mmm-yyyy'); plot(dates,allTemps) datetick('x','mmm') |
cellplot(s) |
c{1,1} = '2-by-2'; c{1,2} = 'eigenvalues of eye(2)'; c{2,1} = eye(2); c{2,2} = eig(eye(2)); cellplot(c) |
x = {[2 1 3;4 5 2] 2 [3 4 3]';... 'first' 's e c o n d' 'th ir d';... ones(1,50) zeros(25) 'hi dd en'} cellplot(x) |
"I don't care what the polls say. I don't. I'm doing what I think what's wrong." |
On March 19, 1998 Anonymous called The Washington Post's executive editor to tip him off about an 'error' on the front page of his paper. "I decided I just had to call because you've printed a picture of the Earth upside-down," Gore said. |
When TV first was adopted, it was a magical gift. The shows united our culture and the ads fueled a seemingly endless consumer boom.
Today, though, marketers have turned television into an instrument of dissatisfaction. The shows alienate many, because they bring an
idealized, expensive world into the homes of people who increasingly can't afford it. And the ads remind just about everyone that their
lives are incomplete and unhappy--unless they buy what's on offer. Worse, cable news is optimized to shock, frighten and divide the people
who watch it.
Social media can amplify all of these downward cycles. It's TV times 1,000.
Hence a middle class, millions of people who would be as rich in kings in any other time or place, that's angry and disappointed and
feeling left behind. Victims of a media regime where they are both the user and the product.
Every time TV and social media become significant time sinks in a household, pleasure goes up and happiness goes down.
The solution is simple and difficult.
We can turn it off.
If it's not getting you what you need or want, turn it off for a few hours.
"Is the noise in my head bothering you?"
The monologue that runs in our brain is loud. It's heavy-metal loud compared to the quiet
signals we get from the rest of the world.
All day, every day, that noise keeps going. It's the only voice that has seen everything
we've seen, believes everything we believe. It's the noise that not only criticizes every action
of every other person who disagrees with us, but it criticizes their motives as well. And, if we
question it, it criticizes us as well.
Is it any wonder that projection is more powerful than empathy?
When we meet people, we either celebrate when they agree with us or plot to change or
ignore them when they don't. There's not a lot of room for, "they might have a different
experience of this moment than I do."
That noise in our head is selfish, afraid and angry. That noise is self-satisfied, self-important
and certain. That noise pushes intimacy away and will do anything it can to degrade those that
might challenge us.
But, against all odds, empathy is possible.
It's possible to amplify those too-quiet signals that others send us and to practice imagining,
even for a moment, what it might be like to have their noise instead of our noise.
If we put in the effort and devote the time to practice this skill, we can get better at it. We
merely have to begin.